Our Sponsors:

Loop Through QueryString

So how you loop through querystring?

The QueryString property is a NameValueCollection object. So you can do something like this(example shown using C#):

foreach (string key in Request.QueryString.Keys)
{
    Response.Write(key+ " "+Request.QueryString[key]+"<br/>");
}

Request.QueryString[key] will give you the value for the key.

So if this is the url http://www.webcosmo.com/listing/Search.aspx?countryId=1&gId=2&dId=48

This loop with print out:

countryId 1

gId 2

dId 48

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: WebCosmo
Posted on: 11/25/2008 at 7:24 AM
Categories: Programming / Coding
E-mail |  Stumble it! |  Propeller it! |  Digg it! |  del.icio.us |  Technorati
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks

The error occurs when a JavaScript code block is placed in the head of MasterPage. Place the code block in a contentplaceholder to resolve the issue.

<head id="Head1" runat="server">
    <title>Untitled Page</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css"/>
    <asp:ContentPlaceHolder ID="myPlaceholder" runat="server">
         <script language="javascript" type="text/javascript" src="<%= Page.ResolveClientURL("~/javascript/global.js")%>"></script>
    </asp:ContentPlaceHolder>
</head>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: WebCosmo
Posted on: 11/17/2008 at 6:40 AM
Categories: Programming / Coding
E-mail |  Stumble it! |  Propeller it! |  Digg it! |  del.icio.us |  Technorati
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed