instead of using Master page use frame set to avoid refresh when click from menu to open a page
Steps:
1. add a webpage in ur application
2. add following code in design
< head runat="server">
< title>Untitled Page< /title>
< /head>
< frameset framespacing ="0" rows="100,*,50" noresize="yes">
< frame name="menu" src="headerpage.aspx" noresize scrolling="no" />
< frame name="content" src="" scrolling="auto" />
< frame name="footer" src="footerpage.aspx" noresize scrolling="auto" />
< noframes>
< body>
< p> your browser not support framesets< /p>
< /body>
< /noframes>
< /frameset>
3. add a webpage in ur application which will contain data of header
add following code in it (menu of header) to open pages in content area of page u added in step1
protected void Button1_Click(object sender, EventArgs e)
{
string url = "studentdetails.aspx";
string framescript = "";
Page.ClientScript.RegisterStartupScript(this.GetType(),"FrameScript",framescript);
}
4. add a webpage in ur application which will contain data of footer
Stop Refresh in Master / Child Page.
Labels: ASP.NET , Master Pages
Stop Refresh in Master / Child Page.
instead of using Master page use frame set to avoid refresh when click from menu to open a page
Steps:
1. add a webpage in ur application
2. add following code in design
< head runat="server">
< title>Untitled Page< /title>
< /head>
< frameset framespacing ="0" rows="100,*,50" noresize="yes">
< frame name="menu" src="headerpage.aspx" noresize scrolling="no" />
< frame name="content" src="" scrolling="auto" />
< frame name="footer" src="footerpage.aspx" noresize scrolling="auto" />
< noframes>
< body>
< p> your browser not support framesets< /p>
< /body>
< /noframes>
< /frameset>
3. add a webpage in ur application which will contain data of header
add following code in it (menu of header) to open pages in content area of page u added in step1
protected void Button1_Click(object sender, EventArgs e)
{
string url = "studentdetails.aspx";
string framescript = "";
Page.ClientScript.RegisterStartupScript(this.GetType(),"FrameScript",framescript);
}
4. add a webpage in ur application which will contain data of footer
Labels: ASP.NET , Master Pages
Set Master Page at Runtime
to set master page for any page at run time. u need to write following code
protected void Page_PreInit(object sender, EventArgs e)
{
this.MasterPageFile = "~/Business_Partner/businesspartner.Master";
}
but page should contain contentplaceholder of same name as it is in master which u are assigning it.
Labels: ASP.NET , Master Pages
Set Master Page at Runtime
to set master page for any page at run time. u need to write following code
protected void Page_PreInit(object sender, EventArgs e)
{
this.MasterPageFile = "~/Business_Partner/businesspartner.Master";
}
but page should contain contentplaceholder of same name as it is in master which u are assigning it.
Labels: ASP.NET , Master Pages