views:

55

answers:

2

hi I am taking login control in simple format(means with out convert to template) and I placed one link button(forgot password) out side of login control

my issue is when user click on forgot password with out entering username then it displays

'*' beside of user textbox inside login control (it validate only user textbox, no need to validate password textbox)

+2  A: 

use validation group

ValidationGroup="groupName"

like

<asp:RequiredFieldValidator ID="rfvName" runat="server" ValidationGroup="gName" ControlToValidate="txtName" ErrorMessage="msg" SetFocusOnError="True"></asp:RequiredFieldValidator>

<asp:LinkButton ID="lbtn" ValidationGroup="gName" runat="server" >Login</asp:LinkButton>&nbsp;&nbsp;
Muhammad Akhtar
A: 

Hi Muhammad,Thank u for your response,but i take login control in that it have predifined validation group for usernae,password .(i take standard Login control

<asp:Login ID="LoginTest" runat="server" Style="z-index: 101; left: 24px; position: absolute;
        top: 33px">
    </asp:Login>
    <asp:LinkButton ID="ForgetPwd" runat="server" Style="z-index: 100; left: 25px;
        position: absolute; top: 193px" ValidationGroup="LoginTest">ForgetPassword</asp:LinkButton>

    <asp:Label ID="lblMsg" runat="server" Style="z-index: 103; left: 172px; position: absolute;
        top: 192px" Text="Label"></asp:Label>

In my requirement i validate only username textbox when customer click forget password ,For Example User is not enter any thing in username textbox and click forget button but it validate for both username and password it dispays errormessage for both. but i want validate only for username

kindly help me in this regard

jaipal