Roey Posted January 5, 2004 Posted January 5, 2004 Yet another newbie HTML / ASPX question. How would I go about not having to reload the menu on the left hand side of my web page, and my title at the top of the web page when navigating between different web pages on my site? Quote
samsmithnz Posted January 5, 2004 Posted January 5, 2004 Yet another newbie HTML / ASPX question. How would I go about not having to reload the menu on the left hand side of my web page, and my title at the top of the web page when navigating between different web pages on my site? You can do this a number of ways. 1. Frames is the old and now commonly frowned appon method. Things tend to get messy when you are targeting frames inside frames and trying to break out of frames, etc. 2. What most people do now is have one page, and "include" in the header and navigation bar as required. This makes your code nice and clean and helps maintainability (which is hard enough on a website). I'm not sure about your level of expertise, but feel free to continue to ask questions, this isn't a subject that can be answered in a couple of paragraphs, whole books have been devoted to the subject. Quote Thanks Sam http://www.samsmith.co.nz
Roey Posted January 5, 2004 Author Posted January 5, 2004 My level of expertise is very limited in Web Sites, as I have been working purely with Windows Forms. I have looked at the code for a few sites and have seen methods such as : <a href="default.aspx?page=contactus"> Is this the method that you are talking about when you mentionusing Includes in the navigation bar ? Quote
samsmithnz Posted January 5, 2004 Posted January 5, 2004 My level of expertise is very limited in Web Sites, as I have been working purely with Windows Forms. I have looked at the code for a few sites and have seen methods such as : <a href="default.aspx?page=contactus"> Is this the method that you are talking about when you mentionusing Includes in the navigation bar ? HAha. This is another method. And there are probably 20 more. This one is probably using one basic page design, with the header and navigation all built in, and a 'content' area. When you click that link some server-side code will check what page you want to load and then retrieve some information from a database. Personally I've never done it this way, but I've always wanted to do something like this. Using a database like this, the website is truely dynamic and can be updated by adding/updated a couple of database entries. Look up the INCLUDE keyword online, theres a bunch of places where you'll find it, and you'll be able to reference files to import into your webpage. Quote Thanks Sam http://www.samsmith.co.nz
yaniv Posted January 5, 2004 Posted January 5, 2004 you can use user control, i think it's the right way toit in aspx, you build the web form, and turn it all into a control. type user control in you visual studio search to go over it. Quote
sharpcoder Posted January 5, 2004 Posted January 5, 2004 you can use user control, i think it's the right way toit in aspx, you build the web form, and turn it all into a control. type user control in you visual studio search to go over it. Yes, this IS the right way to do it in .net. You'll also want to check out caching features which will improve performance. Quote
samsmithnz Posted January 5, 2004 Posted January 5, 2004 I don't think usercontrols are right for this sort of functionality. Before you were talking about a navigation bar and a header, usually fairly static objects! A user control is better for a control that needs more funcationality (Like a textbox that formats and validates any numbers entered). Quote Thanks Sam http://www.samsmith.co.nz
sharpcoder Posted January 6, 2004 Posted January 6, 2004 I don't think usercontrols are right for this sort of functionality. Before you were talking about a navigation bar and a header, usually fairly static objects! A user control is better for a control that needs more funcationality (Like a textbox that formats and validates any numbers entered). Then... What is your suggestion? Quote
samsmithnz Posted January 6, 2004 Posted January 6, 2004 I still think he should use either: 1. Frames 2. Include in the header and navigation bar 3. Statically include the header and naviagtion bar, and dynamically include the content 4. ?? 5 etc there are heaps more options. It really depends on what you're making, and making that judgement call for the method that fits the project best. Quote Thanks Sam http://www.samsmith.co.nz
Administrators PlausiblyDamp Posted January 6, 2004 Administrators Posted January 6, 2004 I personally would tend towards user controls. They are pretty easy to build, have serverside code and can also perform fragment caching so the control's HTML is generated once and reused multiple times. Frames are pretty horrible and using server side code with them is IMHO a nightmare. Include files will work but I find usercontrols a more object orientated way of doing things. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
samsmithnz Posted January 6, 2004 Posted January 6, 2004 I'm going to continue to disagree. If you use Usercontrols, I think you're doing it wrong. What a waste. Quote Thanks Sam http://www.samsmith.co.nz
Administrators PlausiblyDamp Posted January 6, 2004 Administrators Posted January 6, 2004 Could you clarify what you mean by 'What a waste'? A static (or fairly static) usercontrol isn't hard to create by anymeans and can be added to any aspx page with a couple of mouse clicks. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
samsmithnz Posted January 6, 2004 Posted January 6, 2004 Could you clarify what you mean by 'What a waste'? A static (or fairly static) usercontrol isn't hard to create by anymeans and can be added to any aspx page with a couple of mouse clicks. Why use a user control then if its static? Why not just cut and paste/Include in the html? When you use a user control like this, you're only creating another layer. This complicates your design, and goes totally against the KISS principle. Quote Thanks Sam http://www.samsmith.co.nz
Administrators PlausiblyDamp Posted January 6, 2004 Administrators Posted January 6, 2004 Cut and paste would involve more maintenance if the navigation strip ever needs to be updated. Surely a user control that contains nothing more than static HTML is no more of an extra layer than an include file that contains static HTML. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.