<%if(Request.ServerVariables["SCRIPT_NAME"].Contains("PostOpinion.aspx")){Response.Write("Menu_selected");}else{Response.Write("Menu");}%>

what is this code used for ?

If a client request includes a header other than those specified in the IIS Server Variables table, you can retrieve the value of that header by preceding the header name with "HTTP_" in the call to Request.ServerVariables. For example, if the client sends a header such as SomeNewHeader:SomeNewValue, you can retrieve SomeNewValue by using the following syntax:
Copy

<% Request.ServerVariables("HTTP_SomeNewHeader") %>

IIS cannot create client headers. Only a client application, such as a Web browser, can send new headers through an HTTP request. If you want to send hidden data between the client and the server, consider setting and retrieving cookies with Response.Cookies and Request.Cookies. If a client does not accept cookies, you can use the following HTML form tag to send hidden data and retrieve it using the Request.Form collection:
Copy

<FORM ACTION = "myfile.asp" METHOD = "post">
<INPUT NAME="hiddendata" TYPE="hidden" VALUE="secret value">
<INPUT TYPE = SUBMIT>
</FORM>


However, this requires the user to click a button. Alternatively, you can store data in the Session.Contents collection if sessions are enabled on your Web site.

LINK-------------http://msdn.microsoft.com/en-us/library/ms525396%28v=vs.90%29.aspx


With Regard
Shakeb Khan

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.