Sign in to follow this  

[.net] Anything but stinking frames

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For work, I am making the company website dynamic with vb.net and asp.net. There are three parts to my page. A tabbed menu I made (a main menu, and a submenu underneath), then a frame (for now) in the middle for the main page. What I do is I have an xml file that the menus are constructed from (both the main and sub menus). Each menu item has some text and a url that go along with it. The url is loaded into the center frame (blech). It works, though not how I want. I use an iframe actually (with runat=server and an HTMLGenericControl to access it and set the SRC attribute). Anyways, I hate the little scrollbar it produces, and I hate how it just cuts the page off if you don't have the scroll bar. To solve this problem, I put a label instead of a iframe, and used System.IO.Reader to read the html files in plain text from the harddrive and to put that text inside the label. It worked beautifully. No crappy scrollbars or cut-off pages. The only problem is that I can only use plain text html pages. I have some aspx pages that are autogenerated that need to be displayed, and the only way I can do that is a frame because it doesn't add plain html. Is there some other control or way to add a whole webpage to the center of the page other than crappy frames? If I want my tabbed menu user control on top and yahoo.com in the middle, am I stuck using frames? Gah, they're so nasty.

Share this post


Link to post
Share on other sites
One solution is to use a <asp:placeholder> and have your seperate pages as user controls (.ascx) files. You can then use

Control ctrl = LoadControl(pathToAscxFile);
placeholder.Controls.Add(ctrl);

to load the chosen page in.

Personally I don't like this approach as you can end with crazy URL's if you're not careful. I would go with creating a serpate aspx page for each page and using user controls for your tabbed menu.

Hope this helps

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Well, that's kind of what I was doing before, but the problem is that I also want to be able to display plain html pages, or other asp pages.

Share this post


Link to post
Share on other sites

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this