Welcome Guest Search | Active Topics | Sign In | Register

referencing Toolbar CustomItem control via asp.net validator's ControlToValidate Options
Ken Yee
Posted: Friday, November 13, 2009 4:03:33 PM
Rank: Member
Groups: Member

Joined: 11/13/2009
Posts: 22
If you have a toolbar item that looks like this:
<eo:ToolBarItem Type="Custom">
<CustomItem>
<asp:TextBox ID="txtStartDate" runat="server" Enabled="false"
style="vertical-align:middle; font-size: 8pt;" Columns="12"
/>
</CustomItem>
</eo:ToolBarItem>

And you have an asp.net custom validator:
<asp:CustomValidator ID="vldStartDate" runat="server" ControlToValidate="txtStartDate"
ErrorMessage="Invalid Date or Range" OnServerValidate="vldStartDate_ServerValidate"
ValidateEmptyText="True" />

How do you reference the txtStartDate control? If you leave that attribute in, it can't find the control because it's embedded inside another control instead of being part of the page...
eo_support
Posted: Friday, November 13, 2009 4:28:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can not. You can use ToolBarItem.CustomItemInstance.FindControl to find the textbox in your server side code though.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.