title: Error The length of the query string for this request exceeds the configured maxQueryStringLength value
body: <p>Hi Im developing a web application its working fine but yesterday i had a problem when i click a link it gives error </p>
  
  <pre><code> The length of the query string for this request exceeds the configured maxQueryStringLength value.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  
  Exception Details: System.Web.HttpException: The length of the query string for this request exceeds the configured maxQueryStringLength value.
  
  Source Error:
  
  An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
  Stack Trace:
  
  
  [HttpException (0x80004005): The length of the query string for this request exceeds the configured maxQueryStringLength value.]
     System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +9672501
     System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +53
  </code></pre>
  
  <p>when i see the url it gives </p>
  
  <pre><code>http://www.mysitename.com/Teams/Gallery.aspx**?__EVENTTARGET=ctl00%24ContentPlaceHolder1%24rptWeeks%24ctl04%24lnk&amp;__EVENTARGUMENT=&amp;tbcGallery_ClientState={%22ActiveTabIndex%22%3A2%2C%22TabState%22%3A[true%2Ctrue%2Ctrue]}&amp;__VIEWSTATE=%2FwEPDwUJNDYyMTAzODEzD2QWAmYPZBYCAgMPFgIeBVN0eWxlBRZiYWNrZ3JvdW5kLWNvbG9yOmdyYXk7FgICAQ9kFgICBQ9kFgICAQ9kFgJmD2QWCAIBD2QWAgICD2QWAgIFDxYCHgVjbGFzcwUGYWN0aXZlZAIHDxYCHgtfIUl0ZW1Db3VudAIHFg5mD2QWAgIBDw8WBB4PQ29tbWFuZEFyZ3VtZW50BQIxNR4EVGV4dAUYTWFsYTNpYm5hIFByZW1pZXIgTGVhZ3VlZGQCAQ9kFgICAQ8PFgQfAwUCMjcfBAUTTWFsYTNpYm5hIExlYWd1ZSBJSWRkAgIPZBYCAgEPDxYEHwMFAjMyHwQFEFphaW4gT3BlbiBMZWFndWVkZAIDD2QWAgIBDw8WBB8DBQI0Mh8EBRRaYWluIFVuZGVyIDE4IExl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mNi0mpPi0I865O2LxAkzBhdFYaprmaiJymxLDcxE8lkCGq8O%2FK9O%2Bxvyvd6m1rEnMKWo8zEV33E9GFKXkFjcWaCqaAgW2qiov5SRArqihOrSxEYbyJa3g5qQ2Jam7H6jdg0mtjuPgJaWULMB%2FbpCAdf7ktVQXjmrf1y9oq2oWS9acNO9Yc1W5i938A6IkJSOiBwkBn1OwaXcQXjo9pmSp7Z9xBfTzCWOjndtxqVe7P1g60B6H8GaVHt8JQ0P9q28BwvC9cHdFGTamhPR6aaQPzluOZwy2nH0kxwu%2FoUc0j2Hci7AEQbcGPc9OqBo573zFB6oeD6YmSEm3FzZAMGiuKPtJYMLpVWASUEThx6G7J4u8p1gB6XIwUD8ik6AU4%3D**
  </code></pre>
  
  <p>Im not giving any querystring,   the code where error occurs is</p>
  
  <pre><code>&lt;div class="row-fluid"&gt;
                          &lt;div class="span4" style="margin-top: 40px;"&gt;
                              &lt;div class="header"&gt;
                                  &lt;span style="padding-top: 10px; padding-left: 10px;"&gt;Leagues&lt;/span&gt;
                              &lt;/div&gt;
                              &lt;div class="mainbody"&gt;
                                  &lt;asp:Repeater runat="server" ID="rptLeagues" ClientIDMode="Static" OnItemCommand="rptLeagues_ItemCommand"&gt;
                                      &lt;ItemTemplate&gt;
                                          &lt;p&gt;
                                              &lt;asp:LinkButton ID="lnk" runat="server" CommandName="select" CommandArgument='&lt;%# Eval("LeagueId") %&gt;'
                                                  Text='&lt;%# Eval("LeagueName") %&gt;'&gt;  
                                              &lt;/asp:LinkButton&gt;&lt;i class="pull-right" style="font-size: 15pt;"&gt;»&lt;/i&gt;&lt;/p&gt;
                                      &lt;/ItemTemplate&gt;
                                  &lt;/asp:Repeater&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="span4" style="margin-top: 40px;"&gt;
                              &lt;div class="header"&gt;
                                  &lt;span style="padding-top: 10px; padding-left: 10px;"&gt;Stages&lt;/span&gt;
                              &lt;/div&gt;
                              &lt;div class="mainbody"&gt;
                                  &lt;asp:Repeater runat="server" ID="rptStages" ClientIDMode="Static" OnItemCommand="rptStages_ItemCommand"&gt;
                                      &lt;ItemTemplate&gt;
                                          &lt;p&gt;
                                              &lt;asp:LinkButton ID="lnk" runat="server" CommandName="select" CommandArgument='&lt;%# Eval("LeagueId") %&gt;'
                                                  Text='&lt;%# Eval("LeagueName") %&gt;'&gt;  
                                              &lt;/asp:LinkButton&gt;&lt;i class="pull-right" style="font-size: 15pt;"&gt;»&lt;/i&gt;&lt;/p&gt;
                                      &lt;/ItemTemplate&gt;
                                  &lt;/asp:Repeater&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="span4" style="margin-top: 40px;"&gt;
                              &lt;div class="header"&gt;
                                  &lt;span style="padding-top: 10px; padding-left: 10px;"&gt;Weeks&lt;/span&gt;
                              &lt;/div&gt;
                              &lt;div class="mainbody"&gt;
                                  &lt;asp:Repeater runat="server" ID="rptWeeks" OnItemCommand="rptWeeks_ItemCommand"&gt;
                                      &lt;ItemTemplate&gt;
                                          &lt;p&gt;
                                              &lt;asp:LinkButton ID="lnk" runat="server" CommandName="select" CommandArgument='&lt;%# Eval("LeagueId") %&gt;'
                                                  Text='&lt;%# Eval("LeagueName") %&gt;'&gt;  
                                              &lt;/asp:LinkButton&gt;&lt;i class="pull-right" style="font-size: 15pt;"&gt;»&lt;/i&gt;&lt;/p&gt;
                                      &lt;/ItemTemplate&gt;
                                  &lt;/asp:Repeater&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  </code></pre>
  
  <p>cs code</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              FillLeagues();
          }
      }
      protected void rptLeagues_ItemCommand(object source, RepeaterCommandEventArgs e)
      {
          try
          {
              if (e.CommandName == "select")
              {
                  FillStages();
                  rptWeeks.DataSource = null;
                  rptWeeks.DataBind();
                  tbcGallery.Visible = true;
              }
          }
          catch (Exception ex)
          {
              Messagebox.SetPopup("Error Found", ex.Message);
          }
      }
      protected void rptStages_ItemCommand(object source, RepeaterCommandEventArgs e)
      {
          try
          {
              if (e.CommandName == "select")
              {
                  FillWeeks(e.CommandArgument.ToInt32());
                  tbcGallery.Visible = true;
  
              }
          }
          catch (Exception ex)
          {
              Messagebox.SetPopup("Error Found", ex.Message);
          }
      }
      protected void rptWeeks_ItemCommand(object source, RepeaterCommandEventArgs e)
      {
          try
          {
              if (e.CommandName == "select")
              {
                  //FillMatches(e.CommandArgument.ToInt32());
                  tbcGallery.Visible = true;
                  LoadVideos();
                  LoadPictures();
  
              }
          }
          catch (Exception ex)
          {
              Messagebox.SetPopup("Error Found", ex.Message);
          }
      }
  </code></pre>
  
  <p><strong>as you can see i m not giving  any querystring and how i prevent the querystring to autogenerate<br> im using asp dotnet4 Ajaxcontroltoolkit and using updatepanel. Any suggestions?????</strong></p>
  
  <pre><code>&lt;asp:UpdatePanel ID="AjaxPanel" UpdateMode="Conditional" ChildrenAsTriggers="true"
          runat="server"&gt;
  </code></pre>