S
Simon Chuang
Hello,
I use a repeater to display "Name" and "Order". I hope that users can change
the "Order" field from the browser. And, if they input invalid value (such
as string) in the "Order" field, I hope the validator control can alert
them. Can I do this with repeater? Or I should use other webcontrol?
Thanks,
Simon
----------------------------------------------------------------------------
-------
<asp:repeater id="repeater1" runat="server">
<HeaderTemplate>
<table>
<TR class="gridHead">
<TD nowrap>Name</TD>
<TD nowrap>Order</TD>
</TR>
</HeaderTemplate>
<ItemTemplate>
<TR class="gridItem" valign="top">
<TD<%# DataBinder.Eval(Container.DataItem, "Name") %></TD>
<TD>
<asp:textbox id="txtOrder" runat="server" value="<%#
DataBinder.Eval(Container.DataItem, "Order") %>" />
<asp:RequiredFieldValidator ID="valOrder" Runat="server"
ControlToValidate="txtOrder" ErrorMessage="Cannot be empty." />
</TD>
</TR>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
<asp:repeater>
<asp:Button ID="btnSubmit" Runat="server" Text="Submit" />
I use a repeater to display "Name" and "Order". I hope that users can change
the "Order" field from the browser. And, if they input invalid value (such
as string) in the "Order" field, I hope the validator control can alert
them. Can I do this with repeater? Or I should use other webcontrol?
Thanks,
Simon
----------------------------------------------------------------------------
-------
<asp:repeater id="repeater1" runat="server">
<HeaderTemplate>
<table>
<TR class="gridHead">
<TD nowrap>Name</TD>
<TD nowrap>Order</TD>
</TR>
</HeaderTemplate>
<ItemTemplate>
<TR class="gridItem" valign="top">
<TD<%# DataBinder.Eval(Container.DataItem, "Name") %></TD>
<TD>
<asp:textbox id="txtOrder" runat="server" value="<%#
DataBinder.Eval(Container.DataItem, "Order") %>" />
<asp:RequiredFieldValidator ID="valOrder" Runat="server"
ControlToValidate="txtOrder" ErrorMessage="Cannot be empty." />
</TD>
</TR>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
<asp:repeater>
<asp:Button ID="btnSubmit" Runat="server" Text="Submit" />