|
-
Jun 25th, 2003, 06:37 PM
#1
Thread Starter
PowerPoster
-
Jun 25th, 2003, 06:51 PM
#2
PowerPoster
Instead of using an include, make a control. It is basically a mini html page for you, you can have a code behind for it, and still keep it seperate from the page it is on.
If you look at my site:
http://www.variantx.com/Main/Index.aspx
you will notice in the header, right under the graphic I have a label that tells you which page you are on. The whole header is done with a control. That control has its own code behind file that does the processing for the lable.
-
Jun 25th, 2003, 07:04 PM
#3
Thread Starter
PowerPoster
Make what sort of control? And if i make a change to this control do i have to change every page or only change it once and it effects every page?
I don't see any control that allows you to make navigations...
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Jun 25th, 2003, 08:20 PM
#4
PowerPoster
.ascx controls. I think the term is custom server controls....but don't quote me...lol.
The best thing about them is you create one, then you can add it to every page, one page, or any number of pages. Then if you need to make a change, all pages will be changed just by editing the control code itself. It works just like an include.
As far as not seeing any control for navigations, that is right, there isn't one. I was just trying to show you that my header on my web site is a control, I just drag it on to new pages and my header will be just the same on the new page as it is on the old pages.
-
Jun 25th, 2003, 08:54 PM
#5
Thread Starter
PowerPoster
I see, i thought you ment there was an existing control.
I suppose I could create a "custom" control as a header navigation.. but surely to god there has to be an easier way to use includes and code behind modules together.
I mean each page is considered a class so i even figured i create an instance of loginheader.aspx and get to the label that way but i cant becasue it says i am refrencing a null object...?
In old VB with forms you would just say Form2.lblBlah ="ASDADS" how come you can't do that asp.net?
Dim Lbl as New loginheader
loginheader.lblBlah.Text = "ASDASD"
Blah this sux. In PHP this would be so simple. But in php i wouldnt be using labels either.. i would just be putting the code where i wanted it.
Last edited by Arc; Jun 25th, 2003 at 09:18 PM.
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Jun 26th, 2003, 08:35 AM
#6
Thread Starter
PowerPoster
-
Jun 26th, 2003, 08:45 AM
#7
You dont need includes. Period. .ascx controls do EXACTLY what you want and can be accesed from Code Behinds as if you were working with ANY other object.
-
Jun 26th, 2003, 10:52 AM
#8
PowerPoster
Originally posted by Cander
You dont need includes. Period. .ascx controls do EXACTLY what you want and can be accesed from Code Behinds as if you were working with ANY other object.
That was what I was trying to say, they have been made specifically for the reasons you are stating. They are awesome and VERY powerful once you get the hang of them.
I use one for a header, one for a footer, and I use them anywhere that I think maybe I could reuse this functionality. They are sweet.
-
Jun 26th, 2003, 11:36 AM
#9
Yes Cander and Hellswraith converted me to ascx controls also and I second what they have to say.
-
Jun 29th, 2003, 09:08 PM
#10
Thread Starter
PowerPoster
Yah i've been experimenting with these things and they really are simple to make and very easy to use and you can make the code behind modules that mix in with otther ones. It really is the best way to go.
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|