Interview with ASP.net

Recently, in an interview, I was asked the following questions:

  • How will you optimize performance in jQuery in ASP.NET?
  • How many script managers do you have in an ASP.NET application? What for? (Related to AJAX)

Can someone explain the answer to these questions? I do not know about any of them.

+7
source share
6 answers

There can only be one ScriptManager per page. The script manager has several responsibilities, such as loading MS Ajax libraries, creating proxy classes for web services, and supporting partial page rendering (for example, UpdatePanel ). It does not make sense to have more than one per page, and you will get an exception if you try to do this.

If you need to load additional scripts or links in a user control, for example, you can use the ScriptManagerProxy class.

+5
source share

Regarding (1)

  • Use tools like firebug or dynatrace to profile and dig code.
  • JQuery does not go beyond its JavaScript, so you need to know this well for optimization.
  • Follow good JavaScript coding techniques that help for a long time.
  • Always remember that every JS file and line of code that you write is passed to the client for execution, so keep that in mind when writing code, as this causes problems. Therefore, if you decide to include 4 JS files up to 400 KB in size, emans u put burdon on the client, especially if it is on slow lines.

Yes, and for (2), refer to http://forums.asp.net/t/1073734.aspx . There can only be one script manager on one page. Hope this helps :)

+1
source share
  • Watch your selectors, especially when you work with .NET. You do not want to run the same selector multiple times. Instead, you would like to define a javascript variable to hold the selector and then use that variable ... so jQuery does not need to find the same selector many times.

  • You may have 1 ScriptManager per page.

+1
source share

You can have only one ScriptManager per page

0
source share

A page can contain only one script manager in its hierarchy according to the documentation . To optimize jQuery, it is important to use mini-versions of all JS files and useful profiling tools such as Firebug.

0
source share
  • This will be a normal statement to optimize performance. Performance is an important aspect of developing a modern web application. It not only makes the website seamless to use, but also increases the scalability of the website and makes it reliable in the future. In this article, we will look at various aspects of improving the performance of ASP.NET web applications. We will focus only on browser / web server performance, not on optimizing server / application server performance.
  • You can have only one screenwriter per page, otherwise you will get an exception when the application starts.

You can also refer to this link for Questions and Answers Interviews

0
source share

All Articles