WEB开发网
开发学院数据库MSSQL Server User Tips: Using Return Values from a SQL Serv... 阅读

User Tips: Using Return Values from a SQL Server Stored Procedure to Customize Error Messages_QQGB.c

 2007-11-11 10:42:12 来源:WEB开发网   
核心提示: --ASPxfunction showMsg(ctl,args){if(confirm(document.add.txt_title.value)){args.IsValid=true;}else{args.IsValid=false;}}.........

--------------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";
...................
      }
    }

上一页  1 2 3 4 5 6 7  下一页

Tags:User Tips Using

编辑录入:coldstar [复制链接] [打 印]
赞助商链接