JQuery Modal webpart prompts for answer
<p>I have a webpart that pops up a jquery modal on page load. The modal prompts them to answer a question using a radio button list. They select an answer and click Answer (a modal button) which calls the btnAnswer onclick event. Code is below. The issue is that the page is posting back but the btnAnswer_Click event in the code fires but the radiobuttonlist doesn't have a selected value anymore. If I remove all JQuery references it works fine.</p>

<p>Webpart CreateChildControls</p>

<pre><code>btnAnswer = new Button();
btnAnswer.ID = "btnAnswer";
btnAnswer.Text = "Answer";
btnAnswer.CssClass = "ms-buttonheightwidth";
btnAnswer.Click += new EventHandler(btnAnswer_Click);
btnAnswer.Style.Add("display", "none"); //javascript is handling clicking
Controls.Add(btnAnswer);
</code></pre>

<p>Rendered output from the web part</p>

<pre><code>&lt;script language="javascript"&gt; 
$(document).ready(function() {
$("#dialog").dialog({
bgiframe: true,
height: 300,
modal: true,
closeOnEscape: false,
width: 400,
buttons: {
'Skip': function() { if (confirm("Are you sure?")) {__doPostBack('ctl00$m$g_583145bb_3463_40cc_b5ef_6f42c371f376$btnSkip','')}; },
'Answer': function() {__doPostBack('ctl00$m$g_583145bb_3463_40cc_b5ef_6f42c371f376$btnAnswer','')}
       }
   });
});
&lt;/script&gt;&lt;div id="dialog" title="Question" style="display:none"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;What is the Capital of Massachusetts ?&lt;/span&gt;&lt;table id="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02" border="0"&gt;
                    &lt;tr&gt;
                        &lt;td&gt;&lt;input id="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02_0" type="radio" name="ctl00$m$g_583145bb_3463_40cc_b5ef_6f42c371f376$ctl02" value="1" /&gt;&lt;label for="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02_0"&gt;Boston&lt;/label&gt;&lt;/td&gt;
                    &lt;/tr&gt;&lt;tr&gt;
                        &lt;td&gt;&lt;input id="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02_1" type="radio" name="ctl00$m$g_583145bb_3463_40cc_b5ef_6f42c371f376$ctl02" value="2" /&gt;&lt;label for="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02_1"&gt;Springfield&lt;/label&gt;&lt;/td&gt;
                    &lt;/tr&gt;&lt;tr&gt;
                        &lt;td&gt;&lt;input id="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02_2" type="radio" name="ctl00$m$g_583145bb_3463_40cc_b5ef_6f42c371f376$ctl02" value="3" /&gt;&lt;label for="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02_2"&gt;Worcester&lt;/label&gt;&lt;/td&gt;
                    &lt;/tr&gt;&lt;tr&gt;
                        &lt;td&gt;&lt;input id="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02_3" type="radio" name="ctl00$m$g_583145bb_3463_40cc_b5ef_6f42c371f376$ctl02" value="4" /&gt;&lt;label for="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02_3"&gt;Lawrence&lt;/label&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/table&gt;&lt;input type="submit" name="ctl00$m$g_583145bb_3463_40cc_b5ef_6f42c371f376$btnAnswer" value="Answer" id="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_btnAnswer" class="ms-buttonheightwidth" /&gt;&lt;input type="submit" name="ctl00$m$g_583145bb_3463_40cc_b5ef_6f42c371f376$btnSkip" value="Skip Question" id="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_btnSkip" class="ms-buttonheightwidth" /&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;
</code></pre>
