"Varangian" <of****@gmail.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
whats the use for this function RegisterScriptBlock ?
I'm messing around with the ASP.NET 2.0 Callback and in some examples
on the Net I found that the javascript is being added in the Code
behind on the Page_Load event!
Why is this ? Anyone knows?
Loads of reasons. One of the main ones is to allow the server-side code to
provide client-side feedback. E.g. a page may need to be validated
server-side (because maybe the value entered in a textbox has to be looked
up in a database etc). RegisterScriptBlock provides an excellent means of
sending a piece of JavaScript (such as an alert etc) back down to the client
to inform the user that the validation has passed / failed.