Client/Server-side execution of code

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi,

1) is it possible for an asp-button control to execute client-side scripting
as well ?

2) and for an HTML-server control ? I would like to execute client-side code
, and then execute server-side code.

Thnx

Chris
 
Hi Chris,
1) is it possible for an asp-button control to execute client-side scripting
as well ?

of course you can have a client side script on asp:button control.

in the page load you can add this line for having client side validation
btnMyButton.Attributes.Add("onclick","javascript:myJavaScriptFunctionToExecu
te();");
2) and for an HTML-server control ? I would like to execute client-side code
, and then execute server-side code.
for adding the check on the server you need to add the event on the server
and do the necessacary stuff.
Ex:
private void btnMyButton_Click(object Sender,EventArgs e)
{
// code to execute on server
}

HTH
Regards
Ashish M Bhonkiya
 
Back
Top