Click here to Skip to main content
15,914,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to load a master page on submit button click

C#
protected void Go_Click(object sender, EventArgs e)
{
    Response.Redirect("~/MasterPage.master");
}


is this possible to do like this. First login form will open after if he is an authorised user only he should be able to see the master page after clicking submit button.

help me pls..
Thanks in advance.
Posted

There is no way to pass Response.Redirect("~/MasterPage.master");
coz master page only provides layout to child pages.

Make child pages with master page .like home.aspx

Then if the user is login successfully write
Response.Redirect("~/Home.aspx");
 
Share this answer
 
v2
Comments
shwetha_m6 15-Nov-10 5:18am    
Thank u.. :)
You cant write the code like that. You need to import master page.

If you need to import InnerMasterNew.master, then use the code below in your redirecting page.

this.MasterPageFile = "~/MasterPage/InnerMasterNew.master";


it wil work.
 
Share this answer
 
v3
Comments
shwetha_m6 15-Nov-10 5:19am    
Thank u.. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900