我目前的思路是---------aspx文件-----------------------
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<asp:TextBox id="optionValue" Runat="server" />
<br>
</ItemTemplate>
</asp:Repeater>
----------cs文件---------------------------
string[] qqq = new string[optionCount];
Repeater1.DataSource = qqq;
Repeater1.DataBind();现在的问题是无法取到optionValue的值....

解决方案 »

  1.   

    这样做的话会让这些textbox的id都一样的,那怎么能对呢,应该把循环写在cs文件里然后循环取数据库的值.
      

  2.   

    用html的控件<input type=text id=optionValue>后台取用Request.Form["optionValue"];将得到一个逗号分割的字符串,再用split来处理就可以了。
      

  3.   

    不用html,用<asp:TextBox />怎样实现这样的功能呢?
      

  4.   

    这样做的话会让这些textbox的id都一样的,那怎么能对呢,应该把循环写在cs文件里然后循环取数据库的值.
    ------------------------------如果id一样,就容易处理了.我看了生成页面的源代码,各textbox的id都不一样.
    <input name="Repeater1:_ctl0:optionValue" type="text" id="Repeater1__ctl0_optionValue" />
    <br>

    <input name="Repeater1:_ctl1:optionValue" type="text" id="Repeater1__ctl1_optionValue" />
    <br>

    <input name="Repeater1:_ctl2:optionValue" type="text" id="Repeater1__ctl2_optionValue" />
    <br>

    <input name="Repeater1:_ctl3:optionValue" type="text" id="Repeater1__ctl3_optionValue" />
      

  5.   

    http://expert.csdn.net/Expert/topic/2823/2823900.xml?temp=.4179499