Click here to Skip to main content
15,849,829 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to redirect to different content page through my master page but i don't want to refresh my master page.
As our master page is nothing but an content page only but i don't want to refresh master page content.
Ant technology in so that i can achieve it.


Hello friend, you can use Ajax UpdatePanel control in Master Page to refresh the content page only. Try the following code:

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<h1>Master Page</h1>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <hr />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

protected void Page_Load(object sender, EventArgs e)
    Label1.Text = DateTime.Now.ToString();

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

protected void Button1_Click(object sender, EventArgs e)
    Label1.Text = DateTime.Now.ToString();

In this way the content page DateTime will be refreshed in every hit of the button, but DateTime on MasterPage will remain unchanged.

Let me know if you have any further query.

- DD
Share this answer
Nirav Prabtani 14-Jun-14 16:24pm    
For that we have to use Form tag with runat server in in master page and content page as well so is it possible???
sri44 24-Jul-19 3:29am    
Update Panel will not work in the master page for content placeholder tag.Need to put update panel in the content page.
Debabrata_Das 24-Jul-19 7:29am    
sri44 Have you tried the solution that I shared? If not, I would encourage you to try once before getting into any conclusion.
try to use iframe instead masterpage.. :)
Check out this example

<html xmlns="">
<head runat="server">
            height: 1000px;
            width: 100%;
            border: none;
        function SetPageURL(PageURL) {

            document.getElementById("MyFrame").src = PageURL; //iFrame source set dynamically

    <form id="form1" runat="server">
        <div class="Header">
                    <li  önclick="SetPageURL('Home.aspx')">Home</li>
                    <li  önclick="SetPageURL('About.aspx')">About</li>
                    <li  önclick="SetPageURL('Contact.aspx')">Contact Us</li>



        <div class="MainBody">
            <iframe id="MyFrame" src="Home.aspx" class="iframrStyle">


        <div class="Footer">


You can call child page javascript function from parent page in this way.

document.getElementById('MyFrame').contentWindow.FuncName(); //FuncName() is a function of child page.

You can call patent page javascript function from child page in this way.

top.FuncName(); //FuncName() is a function of Parent page.
Share this answer
Member 10202727 14-Jun-14 7:08am    
thanx for it but i don't want to use IFrame and user controls
is it something like asyncpostback ?

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