Client/Server-side execution of code

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
 
A

Ashish M Bhonkiya

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top