question on javascript layers in aspnet

T

tigozilla

I am developing a website with ASP.NET /C#. The items will render
automatically based on their "catID". So that the URL will look similar
to the example:

http://www.domain.com/index.aspx?catID=1
http://www.domain.com/index.aspx?catID=2
http://www.domain.com/index.aspx?catID=3

I'm using a javascript layer to display some items on this page.
However, I want this layer to show only when caID=1. I'm a newbie when
it comes to javascript. So, I was trying to get the url using
"document.url" and use if statement to show/hide the layer. But that
didn't work. Can anybody help or provide some useful hints

Thank you in advance
tigo
 
B

Bob Barrows [MVP]

tigozilla said:
I am developing a website with ASP.NET /C#.

There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.public.dotnet.framework.aspnet
The items will render
automatically based on their "catID". So that the URL will look
similar to the example:

http://www.domain.com/index.aspx?catID=1
http://www.domain.com/index.aspx?catID=2
http://www.domain.com/index.aspx?catID=3

I'm using a javascript layer to display some items on this page.
However, I want this layer to show only when caID=1. I'm a newbie when
it comes to javascript. So, I was trying to get the url using
"document.url" and use if statement to show/hide the layer. But that
didn't work. Can anybody help or provide some useful hints
:)
Wow! This question is doubly off-topic! ;-)
ASP/ASP.Net is server-side technology. It simply generates html to be sent
to the client. Once the page is displayed in the client, we are now in the
realm of client-side scripting (which, in IE, can use either javascript or
vbscript). A more appropriate newsgroup for this question would be one of
the dhtml newsgroups, or the microsoft.public.scripting.jscript group.

Having said all that, the property you are looking for is the
document.location.search property, which is documented here:
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/search.asp

You can find the MS DHTML reference at
http://msdn.microsoft.com/workshop/author/dhtml/dhtml_node_entry.asp

Follow-ups should go to the .scripting.jscript group.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top