For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > July 2006 > RegisterScriptBlock ??









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RegisterScriptBlock ??
Varangian

2006-07-03, 7:04 pm

Hi all,

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?
Thanks very much appreciated

Mark Rae

2006-07-03, 7:04 pm

"Varangian" <ofmars@gmail.com> wrote in message
news:1151938972.522472.250630@b68g2000cwa.googlegroups.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.


Varangian

2006-07-03, 7:04 pm

Oh thanks... for the reply
does it has anything to do with security ?


Mark Rae wrote:
> "Varangian" <ofmars@gmail.com> wrote in message
> news:1151938972.522472.250630@b68g2000cwa.googlegroups.com...
>
>
> 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.


Mark Rae

2006-07-03, 7:04 pm

"Varangian" <ofmars@gmail.com> wrote in message
news:1151965047.621590.263650@h44g2000cwa.googlegroups.com...

> Oh thanks... for the reply


You're welcome.

> does it has anything to do with security ?


Nothing whatsoever.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com