ASP.net Call behind code from client
Friday, April 24, 2009 3:27:45 AM
How to call a function in behind code from client?
Create a project ASP.net (I use Visual.net 2008)
1. In Default.aspx page, select Design mode. Drag a ScriptManager tool into design page and set its attribute "EnablePageMethods = true" (important).
2. Insert a Button into design page, its default id is "Button1". Set its attribute "OnClientClick = functionInClient();"
3. In html <head>..</head> tag, write a function: functionInClient(). This function will call a function in server side.
Create a project ASP.net (I use Visual.net 2008)
1. In Default.aspx page, select Design mode. Drag a ScriptManager tool into design page and set its attribute "EnablePageMethods = true" (important).
2. Insert a Button into design page, its default id is "Button1". Set its attribute "OnClientClick = functionInClient();"
3. In html <head>..</head> tag, write a function: functionInClient(). This function will call a function in server side.





