Question: 1, unable to loop the title and options of the voting Workaround: Add the ItemDataBound event in the repeater binding, with the option RadioButtonList binding, with source code:
Default page, source page
The code is as follows:
<div>
The vast number of netizens on the protection of housing construction related issues investigation <br/>
<asp:repeater id= "Repeater1" runat= "Server" onitemdatabound= "Repeater1_itemdatabound" >
<ItemTemplate>
<table>
<tr>
<TD colspan= "3" >
<b>
<%# Eval ("T_timu")%>
<asp:literal id= "Literal1" text= ' <%# Eval ("t_id")%> ' runat= ' server ></asp:Literal>
Issue 2: Unable to cycle to get user's choice Workaround: First loop the item of the Repeater control to get the RadioButtonList control, loop to detect whether it is selected, and if so, splice it into a string.
And then the title of the number of stitching up, loop Add, with source code:
Dal page:
The code is as follows:
public static bool Dcw_toupiao_insert (string[] XID, string[] pid, int tiaoshu)
{
BOOL flag = FALSE;
for (int i = 0; i < PID. Length; i++)
{
sqlparameter[] PRM = new sqlparameter[2];
Prm[0] = new SqlParameter ("@xid", Int32.Parse (Xid[i));
PRM[1] = new SqlParameter ("@pid", Int32.Parse (Pid[i));
if (Dcw_toupiao_m.dcw_toupiao_gettcount (Convert.ToInt32 (xid[i)), Convert.ToInt32 (pid[i)))
{
Flag = _dc_toupiao_db. Sqlhelper.exeuctenonquery ("Sm_dcw_toupiao_insert", CommandType.StoredProcedure, PRM) > 0;
}
}
return flag;
}
The skills that are mastered: JavaScript Jump:
This. Clientscript.registerclientscriptblock (typeof (String), "OK", "<script>alert (' vote successful! Thank you for participation ') </script>");
Two ways to get controls:
Literal Literal1 = (Literal) e.item.findcontrol ("Literal1");
Literal Literal1 = E.item.findcontrol ("Literal1") as Literal;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.