How can we declare master page at run time?

Posted by Hariinakoti under ASP.NET on 8/8/2012 | Points: 10 | Views : 1225 | Status : [Member] | Replies : 5
Hi Friends,
How can we declare master page at run time?
Please don't post links if you know write the answer otherwise leave it.Plz reply asap.

Thanks & Regards
Hari



Responses

Posted by: Ranjeet_8 on: 8/9/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Try this
protected void Page_PreInit(object sender, EventArgs e) 

{
// Condition
this.Page.MasterPageFile = "~/YourMasterPage.master"; // Set Master Page Location
}


Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Calvert on: 8/9/2012 [Member] Starter | Points: 25

Up
0
Down
In this case, the Label Text property will, of course, need to use a database or text file, and not the page's View State. However, you need to find location somewhere that will accept text, and allow that text to be changed. You cannot use your code for this. Using a text file is a super-simple way to allow some text on your website to be changed.
http://www.dapfor.com/en/net-suite/net-grid/tutorial/data-grouping



Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 8/9/2012 [Member] Starter | Points: 25

Up
0
Down
Thank you Ranjeeth

Thanks & Regards
Hari

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 8/9/2012 [Member] Starter | Points: 25

Up
0
Down
@Calvert
Wat is this i can't understand ur answer.

Thanks & Regards
Hari

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 8/9/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Hi.. @Hariinakoti
Please Mark As Answer, if this helps u
.

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response