Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET try to sync AJAX call with control
    text
    copied!<p>I have two RadioButtonLists, one is an ASP.NET RadioButtonList, and the other is a series of HTML input radio items with a common group name. </p> <p>The javascript for the radioButton click has a call to a server side <code>WebMethod</code> to set a value then when it returns I want to set one of the radiobuttons in the asp radioncontrol to have the ASP event triggered. This is so that the server will send back a new page with updated objects.</p> <pre><code> &lt;asp:RadioButtonList Visible="true" Height="1" Width="1" ID="MyArticleHistory" runat="server" AutoPostBack="true" OnSelectedIndexChanged="MyArticleHistory_SelectedIndexChanged" RepeatDirection="Horizontal"&gt; &lt;asp:ListItem id="OneDayRadioBtn" runat="server" Value="1-Day" /&gt; &lt;asp:ListItem id="ThreeDayRadioBtn" runat="server" Value="3-Days" /&gt; &lt;/asp:RadioButtonList&gt; &lt;input type="radio" name="MyHTMLArticleHistory" id="HtmlOneDay" value="htmlOneDayRadioBtn" checked onchange="OneDayChecked()"&gt; 1-Day &lt;input type="radio" name="MyHTMLArticleHistory" id="HtmlThreeDay" value="htmlThreeDayRadioBtn" onchange="ThreeDayChecked()"&gt; 3-Days </code></pre> <p>... Java script is </p> <pre><code> function OneDayChecked() { alert("We're inside 1 day"); PageMethods.setTimeFilter(0);//0 is the index for the 1-day document.getElementById('&lt;%=OneDayRadioBtn.Selected%&gt;').value = true; //Q: This should cause the asp radio button to change selected index // resulting in a call to the server, correct? } </code></pre> <p>How do I trigger the asp radiobutton onSelectedIndexChange from within the javascript?</p>
 

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