Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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?
Posted
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.

Posted

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 ?

Posted
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.

Posted

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.

Posted
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.

Posted

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).

Posted
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?

Posted

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.

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...