Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to use JSON to get cascading DDLs but not getting response
    primarykey
    data
    text
    <p>I'm trying to create cascading DDLs.</p> <p>My aspx page:</p> <pre><code>&lt;form id="form1" runat="server"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;סוג שולחן&lt;/td&gt; &lt;td&gt;&lt;asp:DropDownList ID="ddlTableType" runat="server" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;קוד שולחן&lt;/td&gt; &lt;td&gt;&lt;asp:DropDownList ID="ddlTableCode" runat="server" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;הנחה קבועה לשולחן&lt;/td&gt; &lt;td&gt;&lt;asp:DropDownList ID="ddlDiscounts" runat="server" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>I'm populating the first DDL from DB and that is working fine.</p> <p>Now, for the second DDL i'm using this code:</p> <pre><code>$(document).ready( function() { $("#ddlTableType").change( function() { $('#ddlTableCode').html(''); var TypeID = $("#ddlTableType &gt; option:selected").attr("value"); $.getJSON('LoadTableCodes.ashx?ObjectType=' + TypeID, function(TableCodes) { alert('aaaaaaaaaaaaaa'); $.each(TableCodes, function() { alert(this['TableCode']); $("#ddlTableCode").append($("&lt;option&gt;&lt;/option&gt;").val(this['TableCode']).html(this['TableCode'])); }); }); } ); } </code></pre> <p>);</p> <p>When i'm browsing to LoadTablesCodes with a typeId im getting the JSON resould. This is working...</p> <p>My problem is with the js code i think, my <strong>$.getJSON</strong> function is not working (can't even get the alert inside the function to pop).</p> <p>Please, what am i doing wrong?</p> <p>10x</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload