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

what is this code used for ?

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by shakeb@techwave
0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.