Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   ASP.NET (http://www.programmingforums.org/forum35.html)
-   -   Onclick (http://www.programmingforums.org/showthread.php?t=14000)

paulchwd Sep 20th, 2007 7:14 PM

Onclick
 
I am not used to programming in ASP.net, i am mainly a C# / Java person, can you explain to me this:

I have a label.. and I want to do something when it is clicked.... ie show another label... i tried this to no avail:

<span><span style="color: activecaption" onclick="<%bestOffer_help.Visible=true;%>">what's this
?</span>&nbsp;<br />


but the label that i want to show was visible as soon as I loaded the page, even though I had visible set to false for it.... none the less... how can i click on a label or text and get it to do something when i click on it

ps: im doing this in ASP.net with c#


many thanks

itgalary Feb 13th, 2008 10:50 AM

Re: Onclick
 
ASP.net IDE will add all the required code by itself isn't?

Just add a label and double click on it

xavier Feb 13th, 2008 1:48 PM

Re: Onclick
 
How often do you see a site where you can just click " some text " and it does stuff ? Asp.Net is not WinForms, it still relies on the old html on the client side. If you want an onclick event , use an <asp:Button or <asp:LinkButton or <asp:HyperLink .

If you want to do it on the client, you can always use JavaScript.

Do take a look at a tutorial on asp.net before asking questions like this.


All times are GMT -5. The time now is 3:10 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC