Simple!
Make both submit buttons, Command Buttons. Each button will call the same
procedure on the server.
asp:Button id="btn1"
Text="Submit"
CommandName="btn1"
OnCommand="Btn_Click"
runat="server"/>
asp:Button id="btn2"
Text="Submit"
CommandName="btn2"
OnCommand="Btn_Click"
runat="server"/>
In the procedure on the server
public sub Btn_click(sender As Object, e As CommandEventArgs)
' examine the CommandEventArgs parameter
if e.CommandName = "btn1" then
' set the validator to true
RValid3.IsValid = true
RValid4.IsValid = true
else
RValid1.IsValid = true
RValid2.IsValid = true
end if
... more code
End sub
This code should cause the validators to be true and thus NOT fire the
error message.
MAKE SURE TO DISABLE CLIENTSIDE SCRIPTING/VALIDATION. In other words You WANT
ALL VALIDATION TO OCCURR ON THE SERVER AND NOT THE CLIENT.
Dallas Martin
Quoting Arindam <[EMAIL PROTECTED]>:
> Hi Champs ..a small problem for you.
> In my web page I have 2 different set of login box,
> with each text box i have validator control.
> I want when i click on submit_btn1 only validators associated with current
> button should get fired.
> not those validators which are with submit_btn2.
> Please have a look at code bellow .. will be have a clear idea.
> txt_box1 <- RValid1
> txt_box2 <- RValid2
> submit_btn1
> =====================
>
> txt_box3 <- RValid3
> txt_box4 <- RValid4
> submit_btn2
>
>
>
>
> Arindam Chakraborty
> Software Developer,
> Mumbai,
> India
>
>
>
>
> Send instant messages to your online friends http://in.messenger.yahoo.com
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income homes are not online. Make a difference this holiday season!
http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/