Вопрос

<asp:TextBox ID="f5" runat="server" CssClass="location" value="" placeholder="Enter Email ID:"
                                        name="location"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ValidationGroup="rqrd" ControlToValidate="f5"
                                        ErrorMessage="Required Field cannot be empty"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ValidationGroup="rqrd" ValidationExpression="^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" ControlToValidate="f5" ErrorMessage="Invalid Email-id"></asp:RegularExpressionValidator>
                                <asp:ScriptManager ID="scriptmanager1" runat="server">
    </asp:ScriptManager>
                                <asp:UpdatePanel ID="PnlUsrDetails" runat="server">
    <ContentTemplate>
                                <div class="location-block">
                                    <div class="form-block location">
                                        Username:</div>`enter code here`
                                    <div class="form-block airport_codes">
                                    </div>
                                    <asp:TextBox ID="f6" runat="server" CssClass="location" AutoPostBack="true" OnTextChanged="f6_TextChanged" value="" placeholder="Enter Username:"
                                        name="location">
                                    </asp:TextBox>

                                    <div id="checkusername" runat="server" Visible="false">

    <asp:Label ID="lblStatus" runat="server"></asp:Label>
    </div>
                                </div>
        </ContentTemplate>
                                    </asp:UpdatePanel>

This is my code the update panel part works perfectly but the other validators have stopped working

p.s. i use visual studio 2012 and i installed ajax control toolkit yesterday only from the manage nuGet packages ... Thanking You in Advance

Это было полезно?

Решение 2

the script manager tag actually asynchronously loads a part of the page but does not reload the java scripts (and thus the required field validators) associated with it. and thus it won't work. So avoid using script manager of c#.net. use normal ajax and jquery functions

Другие советы

Put the ScriptManager above the TextBox and the RequiredFieldValidator.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top