Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Linkbutton click event

Author  Topic 

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-05-18 : 10:05:40
Hi friends

How can i check whether a link button is clicked or not?(within the same page)
I want to perform some validations, if a link button is clicked
But confused how to check whether it have been clicked or not

Can anyone please help me in this?
Thanks

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-05-18 : 10:15:59
??? when a link button is clicked, a Click() event is raised. You don't check to see if it is clicked, you know it is clicked when the event ocurrs.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-05-18 : 10:18:14
Thanks for the reply
I am trying to do something like this

if linkbutton1.clicked = true then
count = 1
else
count = 0
end if

Can i do something like this?
Thanks
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-05-18 : 10:32:42
No -- you do it on the Click() event. You don't need an IF. The event only fires when the linkbutton is clicked.

http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.linkbutton.aspx

Try it. Create a new, blank form. Add a link button. Add some code to the Click() event. See how it works. Read about it and try it out, that's the best way to learn.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -