I had the opportunity to explain this in detail on an article at 4guysfromrolla, at: http://aspnet.4guysfromrolla.com/articles/021104-1.aspx. Although that article was a year ago, I still get regular emails about parts of it. Most people wanted to know how to have a button give a Yes/No prompt, and then trigger the appropriate server event. Eventually to simplify it I wrote a custom-server control and uploaded it to the control gallery on www.asp.net, at: http://www.asp.net/ControlGallery/ControlDetail.aspx?Control=2071&tabindex=2. It's a free control, with a link to a demo.
[Update]: I posted the source code for this control:
The gist of it is you:
- Put a runat=server hidden html control on the WebForm.
- The ASP.Net classes can access the hidden control's value property at the server.
Essentially, you go from Server to Client by registering the script, you go from client to server by submitting the form, and you make data accessible to both by storing it in a runat=server hidden control.
Post a Comment