Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to show pictures by radio button list?
    text
    copied!<p>I have a project that I want show one record from DB by radio button list.and after selecting one option and click on Next button next record loads.this is my Html code :</p> <pre><code>&lt;table style ="width :800px"&gt; &lt;tr&gt; &lt;td style="width: 100px"&gt; &lt;asp:Image ID="Image1" runat="server" ImageUrl="~/images/stdents12.jpeg" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="width: 100px"&gt; &lt;table style="width: 950px" id="TABLE1" onclick="return TABLE1_onclick()"&gt; &lt;tr&gt; &lt;td colspan="8" style="color: white; height: 21px; background-color: #3366ff"&gt; &lt;asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Test No :" Width="82px"&gt;&lt;/asp:Label&gt; &lt;asp:Label ID="TestNo" runat="server" Text="Label" Width="100px"&gt;&lt;/asp:Label&gt;&lt;asp:Label ID="Label2" runat="server" Font-Bold="True" Text="Test Name :" Width="84px"&gt;&lt;/asp:Label&gt; &lt;asp:Label ID="TestName" runat="server" Text="Name Of the Test" Width="501px"&gt;&lt;/asp:Label&gt;&lt;asp:Label ID="Label3" runat="server" Font-Bold="True" Text="Question :"&gt;&lt;/asp:Label&gt; &lt;asp:Label ID="Question" runat="server" Text="N of T" Width="52px"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="width: 23px" rowspan="5"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 1px;"&gt; &amp;nbsp;&lt;/td&gt; &lt;td style="width: 100px; height: 1px;"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 1px;"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 1px;"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 1px;"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 1px;"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 1px;"&gt; &lt;div class="timerCss"&gt; &lt;asp:Label ID="lblTimerCount" runat="server" Height="5px" Width="232px"&gt;&lt;/asp:Label&gt;&amp;nbsp;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="7" align="right"&gt; &lt;asp:Image ID="Image2" runat="server" /&gt; &lt;asp:Label ID="Questionlbl" runat="server" Height="66px" Text="Label" Width="317px"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="7"&gt; &amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="7"&gt; &lt;asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal"&gt; &lt;/asp:RadioButtonList&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="width: 100px; height: 12px;"&gt; &amp;nbsp;&lt;/td&gt; &lt;td style="width: 100px; height: 12px;"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 12px;"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 12px;"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 12px;"&gt; &lt;/td&gt; &lt;td style="width: 100px; height: 12px;"&gt; &lt;asp:Button ID="Button2" runat="server" Text="Skip" Width="55px" /&gt;&lt;/td&gt; &lt;td style="width: 100px; height: 12px;"&gt; &lt;asp:Button ID="BtnNext" runat="server" onclick="BtnNext_Click" Text="Next" Width="70px" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="background-color: silver;" class="style1"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>and this is my code behind page:</p> <pre><code>void Page_PreRender(object sender, EventArgs e) { OnlineExamEntities context = new OnlineExamEntities(); StringBuilder bldr = new StringBuilder(); bldr.AppendFormat("var Timer = new myTimer({0},{1},'{2}','timerData');", this.timerStartValue, this.TimerInterval, this.lblTimerCount.ClientID); bldr.Append("Timer.go()"); ClientScript.RegisterStartupScript(this.GetType(), "TimerScript", bldr.ToString(), true); ClientScript.RegisterHiddenField("timerData", timerStartValue.ToString()); ///////////////////////////// List&lt;int&gt; a = (List&lt;int&gt;)Session["QnumList"]; List&lt;string&gt; resulttemp = new List&lt;string&gt;(); int j = a[Convert.ToInt32(Session["Click"].ToString())]; var q3 = ((from c in context.questions orderby c.QID where c.QID == j select c)).SingleOrDefault(); resulttemp.Add(q3.trueAns.ToString()); Session["result"] = resulttemp; Questionlbl.Text = q3.Question1.ToString(); Image2.ImageUrl = q3.ans4.ToString(); RadioButtonList1.Items.Clear(); string ans1, ans2, ans3; ans1 = q3.ans1.ToString(); ans2 = q3.ans2.ToString(); ans3 = q3.ans3.ToString(); RadioButtonList1.Items.Add(String.Format("&lt;img src='{0}'&gt;", ans1)); RadioButtonList1.Items.Add(String.Format("&lt;img src='{0}'&gt;", ans2)); RadioButtonList1.Items.Add(String.Format("&lt;img src='{0}'&gt;", ans3)); } </code></pre> <p>and when I choose one option and click Next button to load another record I get this error :</p> <p>*<strong>A potentially dangerous Request.Form value was detected from the client (RadioButtonList1="*</strong></p> <p>I adjusted Validate Request ="false" but it's not working.</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