Solution:-
To solve this scenario , I found out one simple solution using javascript
<script type="text/javascript" language="javascript">
function fnValidate(obj)
{
for(var i=0; i<Page_Validators.length; i++)
{
ValidatorEnable(Page_Validators[i]);
if (Page_Validators[i].isvalid)
{
obj.disabled=true;
}
else
{
obj.disabled=false;
break;
}
}
if (obj.disabled==true)
{
<%=Page.GetPostBackEventReference(btnSubmit)%> }
}
</script>
Call this javascript function in button's OnClientClick property as follows.
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClientClick="fnValidate(this);" CausesValidation="true" OnClick="btnSubmit_Click"/>
hi
ReplyDelete