|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do I code for an onClick event for a server control button?
|
|
#2
|
|||
|
|||
|
In ASP.NET? In VisualStudio.NET, you can double click on the control in the .aspx page. The Code-behind will open automatically with the onClick event.
|
|
#3
|
|||
|
|||
|
Sorry, I guess I was not clear enough...I want to write client-side javascript code for the onclick event of a web control.
|
|
#4
|
|||
|
|||
|
I haven't tried this myself but it looks like you add an attribute to the control in the code-behind. Like...
Code:
public void Page_Load(Object sender, EventArgs e)
{
DeleteBtn.Attributes.Add("onclick","javascript:if
(confirm('Do you really want to delete the whole
database?')== false) return false;");
}
This is the post I'm going off. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Server Controls |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|