i use jquery serialize() with asp.net server controls.
<asp:DropDownList ID="ddFirmaAd" runat="server" Width="180" Height="25">
</asp:DropDownList>
when i print the array
ajaxRequest("AjaxServices/Insert.aspx", $("#aspnetForm").serialize(), $('#returnMessage'), 0, $(this));
function ajaxRequest(pageURL, queryString, putArea, timeout, disabledCtrl) {
if (disabledCtrl != null)
disabledCtrl.attr("disabled", "true");
$.ajax({
async: true,
timeout: timeout,
cache: false,
url: pageURL + "?" + queryString,
alert($("#aspnetForm").find("input,textarea,select,hidden").not("#__VIEWSTATE,#__EVENTVALIDATION").serialize());
it prints ddFirmaAd client name on window =”ct100%24ct100%24ContentPlaceHolder1%24ContentPlaceHolder1%24ddFirmaAd = 2 “
i want to get ddFirmaAd.selectedValue on code behind
string value = request.queryString("ddFirmaAd");
but the control name = ct100%24ct100%24ContentPlaceHolder1%24ContentPlaceHolder1%24ddFirmaAd
how to i use serialize() and .net controls ?
How about
string value = request.QueryString(ddFirmaAd.ClientID);but if you pass these values to a different page you can hack it like this:
string value = GetValueById("ddFirmaAd");Not saying that it’s correct. Simply cannot come up with anything better based on the currently provided problem description.
You can configure ClientIDMode to static but then maintaining unique IDs becomes your responsibility and might lead to hard to find client side bugs.