Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to create frames in ASP.NET

Posted on 2004-09-21
8
Medium Priority
?
2,623 Views
Last Modified: 2009-07-29
Hi Experts,

I'm currently using VB.NET for my aspx file. I'd like to create frames for my page so that one frame will maintain the state of the browser. For examples, Let's say I have a logo of my company and some menus on the top of the page. No matter what page a user navigates to, I want the user to always see the logo and the menu. In other words, only the frame below is linked to another aspx file. The top frame will remain the same.

Any help will be appreciated.

thanks.

TJ
0
Comment
Question by:protugy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 15

Expert Comment

by:deepaknet
ID: 12110363
Frames is nothing but plain vanilla HTML. You can manage your frameset as simple as in the case of Ordinary HTML page.

Managing a frameset has a restricted support from HtmlGenericControl class from CodeBehind.
0
 

Author Comment

by:protugy
ID: 12110376
Well, managing a frame maybe is a next step for me. For the time being, I just want to create one.

I do not see a Web Form control nor an HTML control in .NET Web Matrix. How do I include it in the same page?

 Basically, what I want to do is create a web app that similiar to older sites - when a user clicks on an icon, a different web page gets loaded into a frame rather then an entire new page appearing.

thanks.

TJ
0
 
LVL 15

Expert Comment

by:deepaknet
ID: 12110409
It is simply the same old classic HtML Tags TJ:

<frameset rows="20%,*">
   <frame src="" id="test" name="test">
   <frame src="" id="test2" name="test2">
</frameset>
0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 5

Expert Comment

by:LindzK
ID: 12112380
If you need some help with the creating of it - in your solution explorer - if you click on your project name and select 'add new item'.

You can pick a frame page from the options in there.

That then takes you through a little wizard, to produce the type of frameset that you want.
0
 
LVL 5

Accepted Solution

by:
LindzK earned 500 total points
ID: 12112422
As for the clicking on something in one frame, and opening a different page in another

if you use hyperlinks for the user to click on, you can drag and drop a hyperlink from the webforms section of your tool box, and then in properties

set the navigateUrl to the page that you wish to open in the other frame window.
and set the target property to = the name of the frame you wish to open it in.

Or, if you'd rather use code to produce it - in the html version of the form designer you would do something like

<a href="mypage.aspx" target="framename">Click here to open mypage, in the frame to the right of me</a>
0
 

Author Comment

by:protugy
ID: 12115194
Ok.. One more question.. How can I use the information on one frame and pass it to the other? What class do I need to use? Is it Http class? Any example will be very helpful.

thanks.

TJ
0
 
LVL 5

Expert Comment

by:LindzK
ID: 12120735
The easiest way to do it, is to use a hyperlink with a target - either a asp.net control hyperlink, or just hard code it yourself in the html page of the 'menu' page.

Lets imagine you followed my example to create a frame set - so you should ( in the html view of the frame set), have some code that looks like the following :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>Contents Frameset</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</head>
<frameset cols="150,*">
      <frame name="contents" src="Menu.aspx">
      <frame name="main" src="WebForm1.aspx">
<noframes>
<pre id="p2">
================================================================
INSTRUCTIONS FOR COMPLETING THIS CONTENTS FRAMESET
1. Add the URL of your src="" page for the "contents" frame.
2. Add the URL of your src="" page for the "main" frame.
3. Add a BASE target="main" element to the HEAD of your
      "contents" page, to set "main" as the default frame  
      where its links will display other pages.
================================================================
</pre>
<p id="p1">
This HTML frameset displays multiple Web pages. To view this frameset,
use a Web browser that supports HTML 4.0 and later.
</p>
</noframes>
</frameset>
</html>

You now have two frames, one called contents - one called main.

I added two pages in the src of the frames, one called menu.

Inside menu.aspx - you can either drag and drop a webform hyperlink onto your page from the toolbox in the ide, and fill in the location and target in the properties window.  The target would be 'main' as that's the frame where you want your main stuff to appear away from the menu.

Otherwise, you can open up menu.aspx in html view - and just simply type hyperlinks in manually, with a target

such as

<a href="WebForm2.aspx" target="main">Click here for second item</a><br>
<a href="WebForm3.aspx" target="main">Click here for third item</a><br>

Which ever way you do it - when the user clicks on the links, in the left hand frame, a new page will open in the right hand side.

Inside each frame in your frameset - you can use any type of page you want - html page, aspx page etc.


Does this help? or do you need more explanation still :)





0
 
LVL 5

Expert Comment

by:LindzK
ID: 12121451
aah sorry - didn't read your question properly.

you pass information as parameters in the url

http://www.mypage.aspx?myvalue=this is the value

you retrieve it in your code behind module using the request object

Dim value as string  = request.Item("myvalue")

the full class information of a request is this

Public ReadOnly Property Request() As System.Web.HttpRequest
     Member of: System.Web.UI.Page

but you only need to reference request, as the classes it belongs to are already registered in your aspx page
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question