about javascript function
-
I found that some javascript functions are requied to register first by using RegisterStartupScript in order to be used in ASP.net, however, some functions are not required for registration. anyone can help me clarify what kind of javascript funcitons have to be registered?
-
I found that some javascript functions are requied to register first by using RegisterStartupScript in order to be used in ASP.net, however, some functions are not required for registration. anyone can help me clarify what kind of javascript funcitons have to be registered?
Use RegisterStartupScript method to register the client script which needs to placed at the bottom of page. If you have events of controls are tied to client side scripts, then this could be useful. As the control will not be availble at the page strtup, it's good to register them at the bottom. Let me know if this helps you.:)
Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.
-
Use RegisterStartupScript method to register the client script which needs to placed at the bottom of page. If you have events of controls are tied to client side scripts, then this could be useful. As the control will not be availble at the page strtup, it's good to register them at the bottom. Let me know if this helps you.:)
Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.
thanks, what do you mean the "bottom"?
-
thanks, what do you mean the "bottom"?
Bottom means the lower section of the page. Write some page, execute in borwser (e.g. IE) and try to check the view source.
Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.
-
I found that some javascript functions are requied to register first by using RegisterStartupScript in order to be used in ASP.net, however, some functions are not required for registration. anyone can help me clarify what kind of javascript funcitons have to be registered?
Generally, before calling any javascript function, you need to add the source to the head element of the page using script tag. RegisterStartupScript just does this. It adds the script src to the page so that you can call it later. Generally, Startup scripts which are added by ScriptManager is not required to be registered by yourself. As ASP.NET controls adds up those for you. But if you need some custom script to be added to your page, you can use this function. :rose:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.