G Guest Nov 15, 2005 #1 hey all, can you run a client-side script and a server-side script for a single button? thanks, rodchar
hey all, can you run a client-side script and a server-side script for a single button? thanks, rodchar
K Karl Seguin Nov 15, 2005 #2 Sure, the client-side script will run, the postback will intiate as normal, and your server-side event handler will fire. To do so, simply do myButton.Attributes.Add("onClick", "ClientSideFunction();") you have to do it this way, 'cuz by default onClick is for the server-side event. The Button class in ASP.Net 2.0 features a OnClientClick property. Karl
Sure, the client-side script will run, the postback will intiate as normal, and your server-side event handler will fire. To do so, simply do myButton.Attributes.Add("onClick", "ClientSideFunction();") you have to do it this way, 'cuz by default onClick is for the server-side event. The Button class in ASP.Net 2.0 features a OnClientClick property. Karl
G Guest Nov 15, 2005 #3 http://msdn.microsoft.com/library/d...-us/dnaspp/html/aspnet-injectclientsidesc.asp