difference between Registerstartupscript and RegisterBlock [Resolved]

Posted by Swappy_Gaj under ASP.NET on 12/27/2014 | Points: 10 | Views : 434 | Status : [Member] | Replies : 2
What the hell is this,Its making tangent .Cant understand.Please help.
difference between Registerstartupscript and RegisterBlock




Responses

Posted by: kgovindarao523-21772 on: 12/29/2014 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
Hi,

The script block added by the RegisterStartupScript method executes when the page finishes loading but before the page's OnLoad event is raised.
The RegisterClientScriptBlock method adds a script block to the top of the rendered page.
In common,The script blocks are not guaranteed to be output in the order they are registered. If the order of the script blocks is important, use a StringBuilder object to gather the scripts together in a single string, and then register them all in a single client script block.

Deatiled explanation link:
http://www.codeproject.com/Articles/11098/Use-Call-RegisterStartUpScript-RegisterClientScrip

Thank you,
Govind

Swappy_Gaj, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kmandapalli on: 12/29/2014 [Member] Silver | Points: 50

Up
0
Down

Resolved
Hi,

RegisterStartUpScript ->
1. Adds Javascript to the webform,right before the ending <form> tag.
2. Used when we want to assign/retrieve a value or property from any element.
3. holds the code to be run as soon as the browser parses it.

RegisterBlock ->

1. Adds Javascript to the webform, right after the starting <form> tag.
2. holds routines and libraries that the whole page uses.

Mark as answer if satisfied.......

Regards,
Kavya M.


Kavya Shree Mandapalli

Swappy_Gaj, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response