[RESOLVED] disable RequiredFieldValidator depending on button click

I'm wondering if you can disable the RequiredFieldValidator when a certain button is clicked and be enabled when another button is clicked?

I tried with enable = false and true but it didn't work because the onclick event isn't triggered before the right value has been writen.

public void btnNext_OnClick( object sender, System.EventArgs e )
{
rfvZipCode.Enabled = true;
Response.Redirect( "B.aspx" );
}
public void btnPrev_OnClick( object sender, System.EventArgs e )
{

rfvZipCode.Enabled = false;
Response.Redirect( "C.aspx" );
}

<asp:RequiredFieldValidator ID="rfvZipCode" ErrorMessage="Du mste fylla i ett postnr" Runat="server" ControlToValidate="tbZipCode" />
[762 byte] By [Visslan] at [2007-11-20 6:14:24]
# 1 Re: [RESOLVED] disable RequiredFieldValidator depending on button click
Got it!! you must set the CauseValidation attribute on the buttoncontrol to false!
Visslan at 2007-11-9 11:52:39 >