【问题标题】:How to check two different webforms having same value of textboxes如何检查两个具有相同文本框值的不同网络表单
【发布时间】:2013-01-11 12:42:04
【问题描述】:

aspx 文本框1.文本 世界.aspx 文本框1.文本

我希望页面 Hello.aspx 和 World.aspx 具有相同的验证值

请帮助我任何对此有想法的人

【问题讨论】:

    标签: asp.net validation jquery-validate webforms


    【解决方案1】:

    您需要使用 cookie 或数据库或其他方式将值保存在第一页上。 然后在第二页中检索值并比较验证函数或事件中的值。

    using(SqlConnection cn = new SqlConnection(connStr))
        {
    
    
        using(SqlCommand cmd = new SqlCommand())
        {
            cmd.Connection = cn;
    
            string sql = string.Format(@"select email from customers where customer_id = '{0}'", customer_id);
    
            cmd.CommandType = CommandType.Text;
    
            //try and catch block would go here
    
            cmd.CommandText = sql;
    
            cn.Open();
            SqlDataReader rdr = cmd.ExecuteReader();
            string email = rdr[0].ToString();
            cn.Close();
        }
        }
    

    【讨论】:

    • 你能给我一个sql数据库的例子吗
    • 我知道如何存储该值,但我想检索它,请举例说明我的完整问题。
    • 对不起,我不能帮你。
    • 对不起,先生,请帮我解决它对我的项目很重要
    • 请乔治先生帮我解决不要错过了解我
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-03
    • 1970-01-01
    • 2021-02-10
    • 1970-01-01
    • 2013-05-07
    • 1970-01-01
    • 2015-01-25
    相关资源
    最近更新 更多