Identification of Web Forms

Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Identification of Web Forms

 
0
  #1
Mar 30th, 2004
Hi, I am currently creating a website for my company and I am new to VS .NET programming. I have been using it for about two or three months as a trainee but my supervisor has currently gone away for a project she must complete up there. Anyway, my problem is, I am trying to make the header display different colored links for the page in question, no it's not as simple as using the average html alink as it is SPECIFICALLY for the header only and must only change for the page in question. E.g. I am currently on the "Index.aspx" page, I would like for the "Home" link in the header to change from navy blue to dark orange or red, whatever. When I change the page I wish for the "Home" Link to return to navy blue and the page in question's link to be dark orange or red. This is the code I have so far:

PrivateSub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

If (what goes here?) Is ("Index.aspx") Then

lnkHome.ForeColor = Color.DarkOrange

lnkEmp.ForeColor = Color.Empty

lnkVac.ForeColor = Color.Empty

lnkIntrnl.ForeColor = Color.Empty

lnkReg.ForeColor = Color.Empty

lnkLnks.ForeColor = Color.Empty

lnkCntct.ForeColor = Color.Empty

EndIf

EndSub


Oh, by the way, the header is a control, and the code snippet above was extracted from it. If you could help out here I would be so thankful to you as this is the only problem I am stuck on! Thanks very much guys!
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: Identification of Web Forms

 
0
  #2
Mar 31st, 2004
I just tried something else, in index.aspx i've put

imports gwt.head

then I put

lnkHome.ForeColor = Color.Red

I go to build, but there is an error because gwt.head is protected or something?? I will keep trying and keep you updated, I need help!
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 27
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: Identification of Web Forms

 
0
  #3
Apr 2nd, 2004
I'm not sure what gwt is, but its not in the standard .NET Framework. If you remove the imports line, you're code probably should compile properly.

How does your site work? Is everything done off one page with querystrings? Are their seperate ASP.NET Web Forms for each 'highlighed link'?
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: Identification of Web Forms

 
0
  #4
Apr 5th, 2004
head.ascx is the web control I am using for the header, and gwt is the name of my project......
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: Identification of Web Forms

 
0
  #5
Apr 5th, 2004
Sorry, I did not really explain the site properly. Each link is a new webform, I have used zero query strings. Home page is index.aspx, register page is register.aspx, Contact page is contact.aspx and so on.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: Identification of Web Forms

 
0
  #6
Apr 5th, 2004
if you require anything else... let me know please
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 27
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: Identification of Web Forms

 
0
  #7
Apr 8th, 2004
I think you're looking at this from the wrong angle. A better way to make your navigation is with the DataList control. When you make your DataList control, make sure to make a different SelectedItemStyle. When your DataList is setup, all that you need to do is tell the DataList which item to 'select' (use the different style).
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

It WORKS!

 
0
  #8
Apr 13th, 2004
I got it to work!!! The way I intended it to work.

  
PrivateSub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

 

If Request.RawUrl = "/gwt/Index.aspx" Then

lnkHome.ForeColor = Color.Red

lnkVac.ForeColor = Color.Empty

lnkIntrnl.ForeColor = Color.Empty

lnkReg.ForeColor = Color.Empty

lnkEmp.ForeColor = Color.Empty

lnkLnks.ForeColor = Color.Empty

lnkCntct.ForeColor = Color.Empty

EndIf


That is under my header control, it works WOOOOHOOO!

...Now I have to minimise coding by using the case system... hmmm.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Finished

 
0
  #9
Apr 13th, 2004
Hehe Done :cheesy:. It's So satisfying to actually figure something out by yourself. Here is the Code.

  
PrivateSub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

Dim CurrentPage AsString

CurrentPage = Request.RawUrl

SelectCase CurrentPage

Case "/gwt/Index.aspx"
lnkHome.ForeColor = Color.Red
lnkVac.ForeColor = Color.Empty
lnkIntrnl.ForeColor = Color.Empty
lnkReg.ForeColor = Color.Empty
lnkEmp.ForeColor = Color.Empty
lnkLnks.ForeColor = Color.Empty
lnkCntct.ForeColor = Color.Empty
EndSelect

and I just proceeded to put all of the pages in there, works like a charm. However, even though I have been struggling to figure that out, my boss thinks the links are dull and now I have to create some wacky tabacky rollover in photoshop for him. However, my efforts were not a waste as I have learned much along the way to solving that problem. Happy coding all, hope you guys are as successful as I have been... so far .
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC