The process is simple. For this you need to have 3 aspx pages.
1.0 Index Page containing the 2 frames. (Eg: Index_Frame.aspx)
2.0 Content Page containing the buttons (Eg: Content.aspx)
3.0 Target page to get the result of button click (Eg: Main.aspx)
Let me give you the steps.
In the Index Page create two frames each with content.aspx source and main.aspx source
In the form tag of Content.aspx add a attribute as target="Main" , where 'Main' is the name of the second frame. (i.e. which contains Main.aspx)
I have given the sample codes for all the three aspx files.
1.0 Index.aspx
Code:
<html>
<head>
<title>Index_Frame</title>
</head>
<frameset cols="30%,*">
<frame name="Content" src="Content.aspx" frameborder=1/>
<frame name="Main" src="Main.aspx" frameborder=1 />
</frameset>
</html>
2.0A Content.aspx
Code:
<HTML>
<HEAD>
<title>Content</title>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server" target="Main">
<asp:Button id="Button1" runat="server"
Text="Open Yahoo Page" Width="224px"></asp:Button>
<br><br>
<asp:Button id="Button2" runat="server"
Text="Open DotNet Spider Page" Width="224px"></asp:Button>
</form>
</body>
</HTML>
2.0B Content.aspx.cs
In the code behind of Content Page add the following methods to redirect to respective pages.
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("http://www.yahoo.com");
}
private void Button2_Click(object sender, System.EventArgs e)
{
Response.Redirect("http://dotnetspider.com");
}
3.0 Main.aspx
Code:
<!--This is just a blank web form--!>
<html>
<head><title>Main</title></head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server"></form>
</body>
</html>
Hope this may help you out.
Bookmarks