在非母版页上验证ComboBox [英] Validation of ComboBox on non-Master page

查看:52
本文介绍了在非母版页上验证ComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在主页面上有2个文本框和一个提交"按钮,在内容页面上有1个组合框.

每当我单击提交"时,都会显示有关文本框的任何验证错误,但我无法显示ComboBox的验证.我想表明如果ComboBox无效,则不应提交Button,它应该为此显示一条消息.

我还尝试过在ComboBox的内容页面上进行验证控制,但没有成功.

[edit]主题:请带我离开这里"对您没有帮助:请尝试更具描述性.
转换为英文. -OriginalGriff [/edit]

I have 2 TextBoxes and a "Submit" Button on the Master page & one ComboBox on my content page.

Whenever i click on "Submit" any validation errors regarding textboxes are displayed but I can''t show validation for the ComboBox. I want to show that the Button should not submitted if the ComboBox is not valid, it should show a message for that.

I have also tried validation control on content page for ComboBox but it didn''t work.

[edit]Subject: "Plz bring me out from here" does not help: try to be more descriptive.
Converted to English. - OriginalGriff[/edit]

推荐答案

尝试此
InterviewCategory.items.insert(0,"select");

try this
InterviewCategory.items.insert(0,"select");

<asp:DropDownList ID="ddl_InterviewCategory" runat="server" AutoPostBack="True"

                            onselectedindexchanged="ddl_InterviewCategory_SelectedIndexChanged">
                        </asp:DropDownList><asp:RequiredFieldValidator ID="rfv_Category" ControlToValidate="ddl_InterviewCategory" runat="server" ErrorMessage="Category"

                                    SetFocusOnError="true" InitialValue="Select" Display="dynamic">*</asp:RequiredFieldValidator>


这篇关于在非母版页上验证ComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆