User Tips: Using Return Values from a SQL Server Stored Procedure to Customize Error Messages_QQGB.c
2007-11-11 10:42:12 来源:WEB开发网--------------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";
...................
}
}
更多精彩
赞助商链接