Recently i was asked
(1) "How will you do performance optimization over your jQuery in ASP.net ?"
(2) "How many script manager can we have in ASP.net Application?" why? (Ajax related).
I have no ideas on both.Help me to grow.
Recently i was asked
(1) "How will you do performance optimization over your jQuery in ASP.net ?"
(2) "How many script manager can we have in ASP.net Application?" why? (Ajax related).
I have no ideas on both.Help me to grow.
I am also not sure on what to answer for question #2, but I can give some thing for question #1
If you were not able to answer question #1 means that you have a fairly less idea about JQuery, I suggest learning JQuery to a fair extent first.
Coming to the question, there are a lot of things that you can do to optimize your JQuery, like while coding it you can follow the tips mentioned in the following links :
http://jonraasch.com/blog/5-performance-tuning-tricks-for-jquery
http://jonraasch.com/blog/10-advanced-jquery-performance-tuning-tips-from-paul-irish
Regarding (1)
Yes and for (2) refer http://forums.asp.net/t/1073734.aspx link. One page can only have one script manager. Hope that helped :)
A page can contain only one script manager in its hierarchy according to the documentation. For jQuery optimization, it is important to use minified versions of all JS files and profiling tools such as Firebug are helpful.
You can only have one ScriptManager
on a page. The script manager has several responsibilities, such as loading the MS Ajax libraries, creating proxy classes for web services, and enabling partial page rendering (e.g. UpdatePanel
) support. It doesn't make sense to have more than one per page, and you'll get an exception if you try to do this.
If you need to load additional scripts or references, in a user control for example, you can use the ScriptManagerProxy
class.
Watch your selectors, especially when you are working with .NET. You don't want to run the same selector multiple times. Instead you would want to define a javascript variable to hold the selector and then use that variable...that way jQuery is not having to find the same selector multiple times.
You can have 1 ScriptManager per page.