On the server, we use ASP.NET to execute C# or VB.NET code.
On the client (the user's browser), we have HTML, Javascript and CSS.
Typically, we use our server-side code to dynamically create the HTML, JS and CSS which is sent to the client.
Because a frameset is just plain-jane HTML, then ASP.NET can certainly create a frame-based website.
However, once your ASP.NET code has create the frameset and sent it to the client, ASP.NET loses touch with it. The actual functioning of a frameset occurs on the client. Passing values back and forth, having one frame change the page of another, etc, all occurs on the client with Javascript.
So, yes, you can use ASP.NET tocreate framed pages.
But, no, you cannot use ASP.NET tocontrol the framed pages.
For example, you cannot use ASP.NET so that PageA retrieves values from PageB (at least, not without a lot of effort on your part).
In my opinion, frames introduce many many more problems than they solve. So, if you can avoid them, do so.
I hope this helps.
hello SomeNewKid, can u give me an alternative to the framed page? I'm totally new to asp.net, starting to learn with vs.net using vb.net, what is a better solution to the html frameset? i want to make a page which is almost like normal html page with frameset of upper and left panel. can u help me out? thx
I do agree with SomeNewKid that frames should be avoided.
What you can do is either the following:
1- Create an ASPX page with a main table, include in the upper cell a UserControl called Header.ascx, Footer cell, a Footer.ascx, and leave the cell in the middle to place your content inside it. Then each new page you would copy that table and put your content for that specific page inside the content cell left blank.
Well, that is not the optimal solution, but being a beginner you can start with.
Other solution in ASP.NET 1.1 is to use Master Pages, have a look at:
MasterPages: Improved Version
Hope that helps a bit,
Regards
Before frames became available, most web pages were created by hand. This would mean that the website developer would have to cut and paste the same "common HTML" (such as headers and navigation menus) into every single page. If a new page was added to the website, every single page would have to be updated to include that new page in the navigation HTML.osxchd wrote:
what is a better solution to the html frameset?
Frames became available and allowed a web developer to create *one* page for the common HTML, and place it in the top or left frame. Then, all other pages could be created independently of each other, with no common HTML shared between them. While this solved the problem of sharing HTML between pages, it introduced its own set of problems (pages could not be bookmarked, JavaScript was needed to communicate between frames, and other headaches).
So, frames really only solved one problem: how to share code between pages. This was an okay solution at the time. Now, we have technologies such as PHP, ASP, and everybody's favourite, ASP.NET. These technologies also allow us to put code into a separate file and then share it between pages (using #include statements in PHP and ASP, and using User Controls in ASP.NET). The great thing about these technologies is that the final page is a single page, and not a frameset. So, these technologies provide the same benefit as frames, but without the set of problems introduced by frames.
So, if you have ASP.NET available, how can you get the same sort of benefits as frames provide?
Thesimple answer is that you can use an HTML <table> element to split your page into a grid. You then place inside the top of the grid a Header.ascx User Control, and place in the left cell of the grid a Navigation.ascx User Control. The actual content of each individual page goes into the right cell of the grid.
To learn about User Controls, please read theUser Controls QuickStart Tutorial. Actually, that's a pretty poor introduction to User Controls. You may prefer:Building ASP.NET User and Server Controls -- Part 1.
Finally, I said above that thesimple answer is to use an HTML <table> element to split your page into a grid. While this is a very common technique, it too is largely outdated now, replaced by CSS layout. However, if you are new to HTML and to ASP.NET, you should start with the simplicity of using a <table> to control the layout of your page.
No comments:
Post a Comment