menu control refresh page

In ASP.NET 2.0 I have a master page with menu control.
when the user choose an option in the menu it goes to one of the content pages of the placeholder.
The problem is that pressing the menu control refresh the whole page.
I thought of putting in in Iframe but I already have everything in master or content pages and I don't
know how the ifrmae will get into it?
Any suggestion? so that the menu will not refresh the master page?
ANAT2403Asked:
Who is Participating?
 
Darth_helgeCommented:
The content placed on your master page will of course get reloaded when you navigate to another .aspx page which has the current MasterPage. You cannot prevent the master page content to be reloaded except using frames or AJAX/Javascript
0
 
Irwin SantosComputer Integration SpecialistCommented:
put the refresh in the subpage(target)
0
 
Darth_helgeCommented:
maybe i dont understand but my menu control does not refresh the page

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body style="height: 100%">
    <form id="form1" runat="server">
<asp:menu ID="Menu1" runat="server">
<Items>
<asp:MenuItem Target="MyFrame"  NavigateUrl="http://www.break.com" Text="Click ME!"></asp:MenuItem>
</Items>
</asp:menu>        

<iframe id="MyFrame" name="MyFrame" height="200" width="400"></iframe>
    </form>
</body>
</html>
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ANAT2403Author Commented:
to irwinpks:
I don't put any refresh its automatic   . How you want me to make the refresh?

to Darth helge:
I took you kod added some more menu items and some are refresh but yours not. But still I don't understand
why some do refresh?

<%@ Page Language="C#" AutoEventWireup="false" CodeFile="Default9.aspx.cs" Inherits="Default9" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body style="height: 100%">
    <form id="form2" runat="server">
<asp:menu ID="Menu1" runat="server" Orientation="Horizontal">
<Items>
<asp:MenuItem Target="MyFrame"  NavigateUrl="http://www.break.com" Text="Click ME!" Value="Click ME!"></asp:MenuItem>
    <asp:MenuItem   Text="item2" Value="item2"></asp:MenuItem>
    <asp:MenuItem   Text="item3" Value="item3"></asp:MenuItem>
</Items>
</asp:menu>        

<iframe id="MyFrame" name="MyFrame" height="200" width="400"></iframe>
 
  <asp:Label ID="Label1" runat="server" Style="z-index: 100; left: 544px; position: absolute;
            top: 64px" Text="Label" Width="72px"></asp:Label>
        <asp:Label ID="Label2" runat="server" Style="z-index: 101; left: 616px; position: absolute;
            top: 184px" Text="Label" Width="80px"></asp:Label>
        <asp:Label ID="Label3" runat="server" Style="z-index: 103; left: 528px; position: absolute;
            top: 288px" Text="Label" Width="120px"></asp:Label>      
    </form>
</body>
</html>
0
 
Darth_helgeCommented:
you have to add the navigateURL on all of the menuitems
0
 
ANAT2403Author Commented:
As I wrote at the beginning of the question I am not using Iframe but a master page and content and there
I have navigateurl in the code behind and it goes to a panel in the content page. Maby my problem is
specific to the situation of Master page.do you know about that?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.