Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 1.05 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jquery serialize and .net controls
  2. <asp:DropDownList ID="ddFirmaAd" runat="server" Width="180" Height="25">
  3.         </asp:DropDownList>
  4.        
  5. ajaxRequest("AjaxServices/Insert.aspx", $("#aspnetForm").serialize(), $('#returnMessage'), 0, $(this));
  6.  
  7.  function ajaxRequest(pageURL, queryString, putArea, timeout, disabledCtrl) {
  8.         if (disabledCtrl != null)
  9.             disabledCtrl.attr("disabled", "true");
  10.         $.ajax({
  11.             async: true,
  12.             timeout: timeout,
  13.             cache: false,
  14.             url: pageURL + "?" + queryString,  
  15.  
  16.  
  17. alert($("#aspnetForm").find("input,textarea,select,hidden").not("#__VIEWSTATE,#__EVENTVALIDATION").serialize());
  18.        
  19. string value = request.queryString("ddFirmaAd");
  20.        
  21. private string GetValueById(string endsWith)
  22.     {
  23.         var qs = HttpContext.Current.Request.QueryString;
  24.         foreach(var key in qs)
  25.         {
  26.             string skey = key.ToString();
  27.             if(skey.EndsWith(endsWith))
  28.             {
  29.                 return qs[skey];
  30.             }
  31.  
  32.         }
  33.         return string.Empty;
  34.     }