开发者

Displaying error message in a page in which the required field is in a user control

I have two tab panels, and in each of these there is a user control.

<asp:Label ID="lblWarning" runat="server"></asp:Label>
<asp:TabContainer ID="tabContainer" runat="server">
    <asp:Tab开发者_运维技巧Panel ID="tab1" runat="server">
        <contenttemplate>
             <uc3:YYY ID="userControl1" runat="server" />
    </asp:TabPanel>
    <asp:TabPanel ID="tab2" runat="server">
        <contenttemplate>
             <uc1:XXX ID="userControl2" runat="server" />
        </contenttemplate>
    </asp:TabPanel>
</asp:TabContainer>

Now consider that I have a required field validator in one of my user controls, and there is a label in the main page as you see. When I clicked a button in main page, I want to display required field validator's error message in my main page's label(lblWarning).

Is this possible or not, and if yes, how? Thank you all...


In the end, I could not solve this problem, and I have written a javascript alert function for displaying the required filed validators message.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜