|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
![]() Hey Guys, I would like to know that how do i use HTML Frameset in asp.net. I would like to add three .aspx pages in a single web page. So, that each web page would work separately. Is it possible for me to do so? Does any body knows about it? Kindly provide me the correct logical solution for the above issue. Any kind of information on the above issue would be appreciated. Thanks a lot. |
#2
| |||
| |||
Re: How can i use Frameset in asp.net 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> 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> 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. ![]() |
#3
| |||
| |||
Re: How can i use Frameset in asp.net You should avoid frames at all costs. Try using server requests. Also, you can use placeholders and change which file is included depending on which request is made. This way when the page is requested the placeholder uses the requested include. This can be done on server side. |
![]() |
|
Tags: aspnet, frameset, use |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to use Frameset Tag in HTML? | MELTRONICS | Software Development | 6 | 29-01-2010 05:46 PM |