ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
How can you change a Master page dynamically in which event
of page life cycle?
 Question Submitted By :: Kiran
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How can you change a Master page dynamically in which event of page life cycle?
Answer
# 1
In Page_PreInit(object sender, EventArgs e)  Event ...
 
Is This Answer Correct ?    7 Yes 3 No
Ss
 
  Re: How can you change a Master page dynamically in which event of page life cycle?
Answer
# 2
Unfortunately there is not built in support to change page 
themes at runtime. Here is a simple code which can be used 
to change page themes at runtime:
At first though we may say we can easily achieve this by 
coding it in Page_Preinit Event as shown below. 

protected void Page_PreInit(object sender, EventArgs e)
    {
       Page.Theme = "Black"
       
    }

But problem with this is we cant assign value from dropdown 
box because Page_Preinit event is fired much before 
dropdown has changed value.

To resolve this issue, just use the following steps:
1-Create one session variable which will hold current theme 
value 
2-On selection change event of dropdown combo box , assign 
value form combo box to session variable. 
3-During Page_preInit Event assign this variable value to 
Page.Theme property. 
4-Stop page loading and reload same page again using 
server.transfer method as shown below 


protected void Page_PreInit(object sender, EventArgs e)
    {
        string thm;
        thm = (string)Session["themeSelected"];
        if (thm != null)
        {
            Page.Theme = thm;
            DropDownList1.Text = thm;
        }
        else
        {
            Session["themeSelected"] = DropDownList1.Text;
            Page.Theme = "Blue";
        }

protected void DropDownList1_SelectedIndexChanged(object 
sender, EventArgs e)
    {
        Session["themeSelected"] = DropDownList1.Text;
        Server.Transfer(Request.FilePath);

    }

 
 
Is This Answer Correct ?    3 Yes 0 No
Ashutosh Tripathi
 
 
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
What is the purpose of the validation summary control? What do you need to do to prevent an error message from being displayed in a validator when a validation summary control is used? How can you display a message in both the validator and the validation summary control?  1
What?s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"? SLC-Ltd3
if you disable view state of a textbox will it maintain data during postbacks.if yes reason FactorH6
can i use store procedure in disconnected mode? give me answer  2
What?s a bubbled event? Visual-Soft5
How do you manage session in ASP and ASP.NET? Microsoft1
we can able to display a MessageBox in asp .net without using any script langages? ABC5
How many types of page. TCS5
What are typed datasets? IBS1
What is view state and how this can be done and was this there in asp ? Accenture1
Difference Between ReadOnly and Constant Variable in compile time and Run Time. Phoenix-Technologies3
what does membership class provide?  1
Why Web Services?  1
version information is mentioned in which file AG-Technologies3
Whats an assembly?  5
Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.  1
How do you do exception management? Accenture1
what are the files used in asp .net  1
How to Insert a TextBox value in to Sql database using C# coding? Sona6
why security trimming attribute?  1
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com