P
philipl
hi,
i have a textbox in my edititemtemplate in my datagrid. I have created
a customvalidator for it, when i update the row the appropiate
function gets called to customvalidate but the problem is that the
error message in my customvalidator does not get printed in the
datagrid even though I have set the isvalid property in the server
function to false. Does anyone know why this is?
Here is the code snippets:
protected void cbLangCheck(object source, ServerValidateEventArgs
args)
{
if(insert_lang.Items.FindByText(args.Value) == null)
{
args.IsValid = false;
return;
}
else
{
args.IsValid = true;
return;
}
}
<asp:TemplateColumn HeaderStyle-CssClass="header"
HeaderText="External Ref">
<ItemTemplate>
<asp:Label runat="server" ID="extref"
Text='<%#DataBinder.Eval(Container.DataItem, "ExtRefKey")%>'/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox CssClass="standard-text" ID="extrefentry"
Text='<%#tmsettings.ExtRef%>' runat="server" />
<asp:CustomValidator Runat="server"
EnableClientScript="False" ControlToValidate="extrefentry"
OnServerValidate="tbrefCheck" ErrorMessage="You must select language
from list" Display="Dynamic"></asp:CustomValidator>
</EditItemTemplate>
</asp:TemplateColumn>
i have a textbox in my edititemtemplate in my datagrid. I have created
a customvalidator for it, when i update the row the appropiate
function gets called to customvalidate but the problem is that the
error message in my customvalidator does not get printed in the
datagrid even though I have set the isvalid property in the server
function to false. Does anyone know why this is?
Here is the code snippets:
protected void cbLangCheck(object source, ServerValidateEventArgs
args)
{
if(insert_lang.Items.FindByText(args.Value) == null)
{
args.IsValid = false;
return;
}
else
{
args.IsValid = true;
return;
}
}
<asp:TemplateColumn HeaderStyle-CssClass="header"
HeaderText="External Ref">
<ItemTemplate>
<asp:Label runat="server" ID="extref"
Text='<%#DataBinder.Eval(Container.DataItem, "ExtRefKey")%>'/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox CssClass="standard-text" ID="extrefentry"
Text='<%#tmsettings.ExtRef%>' runat="server" />
<asp:CustomValidator Runat="server"
EnableClientScript="False" ControlToValidate="extrefentry"
OnServerValidate="tbrefCheck" ErrorMessage="You must select language
from list" Display="Dynamic"></asp:CustomValidator>
</EditItemTemplate>
</asp:TemplateColumn>