validation problem in asp.net -
i using page.isvalid function in web page.i have 2 buttons in web page namely "save" , "generate".when click save button validation summary invoked in validations in page shown.
now dont want show particular validation message "save" button, same validation message should shown "generate" button in same page.
but using page.isvalid in "save" button click displaying validation messages in page.
any appreciated.thanks
you can use validationgroup(s) this.
<form id="form1" runat="server"> <div> <asp:textbox id="textbox1" runat="server" /> <asp:requiredfieldvalidator id="r1" runat="server" errormessage="*" validationgroup="generateonly" controltovalidate="textbox1" /> <asp:button id="generate" runat="server" text="generate" validationgroup="generateonly" /> <asp:button id="save" runat="server" text="save" /> </div> </form>
this example triggers validator if generate clicked, not when save clicked, , works when calling page.isvalid in buttons onclick function.
Comments
Post a Comment