.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> ASP.Net >> Post New Question Subscribe to Interview Questions

Can we add multiple script managers on a single page?

Posted By :Sajid P K     Posted Date :November 11, 2010    Points :10   Category :ASP.Net 
No it will throw error, a page can contain only one ScriptManager control in its hierarchy. To register services and scripts for nested pages, user controls, or components when the parent page already has a ScriptManager control, use the ScriptManagerProxy control.

The purpose of ScriptManager is just to enables AJAX In Your Web Application. so adding multiple ScriptManager doesn't make any sense.

You can also find related Interview Question to Can we add multiple script managers on a single page?  below: 

Is Multiple Pages possible In Single asp.net Page?

  
We can achieve this in simple way by using FrameSet .... (More...)

Is it possible to use Multiple Script Manager in the Web page?

  
No , I think, It is not possible to use it .But Single Script manager is enough. (More...)

Can multiple catch blocks be executed for a single try statement?

  
No. Once the proper catch block processed, control is transferred to the finally block (if any).

So we can not execute multiple catch block in one try block (More...)

How can you cache Multiple Versions of a Page?

  
Using output cache you can cache multiple versions of the page.

We can either use,.

- @ OutputCache directive at design time declaratively for Declarative Approach
OR

- Response.Cacheclass at runtime for Programmatic Approach .

With @ OutputCache directive four parameters of VaryByParam , VaryByControl, VaryByHeader, VaryByCustom allows user to cache page depending on query string, control value, request's HTTP header, request's HTTP header respectively.

For an example:

To turn off caching,

Declarative Approach:
<%@ OutputCache Location="None" VaryByParam="None" %>

Programmatic Approach:
Response.Cache.SetCacheability(HttpCacheability.NoCache);


To cache the output for each HTTP request that arrives with a different ID:

Declarative Approach:
<%@ OutputCache duration="60" varybyparam=" ID" %>

Programmatic Approach:
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.VaryByParams["ID"] = true; (More...)

Populate multiple controls from DB in a single function using a single DataSet

  
Step 1:
- Write the different queries for getting the data from the DB for different controls in a single string variable by separating them with semicolon.

Ex -
//Create the SQL query.
string selectQueryForControlPopulation =
"SELECT COL1,COL2,... FROM TABLE_NAME1 WHERE CONDITION; SELECT COL1,COL2,..FROM TABLE_NAME2 WHERE CONDITION; ......";
Step 2:
- Create the DataAdapter, DataSet object. Execute the query and fill the DataSet object.

Ex -
//Create the Connection object.
OleDbConnection oConnection = new OleDbConnection(ConfigurationSettings.AppSettings["SQLConnectionString"]);

//Create the Command object.
OleDbCommand oCommand = new OleDbCommand(selectQueryForControlPopulation , oConnection );

//Create the DataAdapter object and set its property.
OleDbDataAdapter oAdapter = new OleDbDataAdapter();
oAdapter .SelectCommand = oCommandPopulateOrganizations;

// Create a DataSet object.
DataSet oDataSet = new DataSet();

//Filling the DataSet object.
oAdapter .Fill(oDataSet);

(**) The DataSet object contain the result of different queries as different tables. We can access those table to fill our controls.

http://www.mindfiresolutions.com/Populate-multiple-controls-from-DB-in-a-single-function-using-a-single-DataSet-831.php (More...)

You are designing a single person shooter game application. The player can choose between multiple guns.
1) Pistol with 5 bullets
2) Shotgun with 100 bullets
3) Grenade Launcher with 20 grenades

Each gun will have different sound effects and graphics.

Pressing Ctrl+Space should rotate between guns.
Which design pattern should you employ for this?

  
Use Strategy Pattern.

Explanation: Each gun having different performance and graphics.
So this can be accomodated in the algorithm.

Strategy pattern is best suited for shifting the guns/algorithms

There will be a IGun interface implemented by 3 classes
Pistol : IGun
Shotgun : IGun
GrenadeLauncher : IGun (More...)

Can we use multiple ScriptManager on a page?

  
No. You can use only one ScriptManager on a page.
(More...)

Can multiple catch blocks be executed for a single try statement?

  
No. Once the proper catch block processed, control is transferred to the finally block (if there are any). (More...)

Can we put multiple catch blocks in a single try statement in C#?

  
Yes. Multiple catch blocks may be put in a try block. (More...)

Can we have multiple document.ready() function on the same page?

  
YES. We can have any number of document.ready() function on the same page. (More...)

Can code inside multiple catch block be executed?

  
No, Code can not execute in mutiple catch block (More...)

Does C# support multiple inheritance?

  
No

C# does not support multiple inheritance. A class can inherit from maximum one base class, although it can implement any number of interfaces. Like Java, C# does not support multiple inheritance, meaning that classes cannot inherit from more than one class (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend