--------------aspx--------------------
function showMsg(ctl,args)
{
if(confirm(document.add.txt_title.value))
{
args.IsValid=true;
}
else
{
args.IsValid=false;
}
}
.................
<asp:textbox id="txt_title" runat="server" CssClass="stedit" Width="240"></asp:textbox>
<asp:textbox id="txt_hidden" runat="server" CssClass="stedit" Width="0" ReadOnly="True"></asp:textbox>
..................
<asp:CustomValidator id="Customvalidator2" runat="server" OnServerValidate="Val2" ClientValidationFunction="showMsg" ControlToValidate="txt_hidden" Display="Dynamic"></asp:CustomValidator>
--------------------cs----------------------
...................
public void Val2(object sender, ServerValidateEventArgs e)
{
e.IsValid=true;
}
...................
private void Page_Load(object sender, System.EventArgs e)
{
...................
if(!Page.IsPostBack)
{
txt_hidden.Text="init hidden textbox";
...................
}
}