当前位置:网站首页>asp. Net - edit hyperlink event
asp. Net - edit hyperlink event
2022-07-21 15:16:00 【I Can -Jiang】
Edit value transfer :
<asp:LinkButton ID="lbtnbj" runat="server" CommandArgument='<%# Eval("djbh")+","+Eval("PR_type") %>'
OnClick="lbtn_Click"> edit </asp:LinkButton>
lbtn_Click() event
protected void lbtn_Click(object sender, EventArgs e)
{
LinkButton lbtn = sender as LinkButton;
string[] estr = lbtn.CommandArgument.ToString().Split(',');
string djbh =estr[0];
string pr_type = estr[1];
string sql = "";
string errMsg;
string userLog = DB.Cookie.GetValue("login");
if (userLog == null || userLog == "")
{
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>window.alert(' Failed to get login user , Please login again !')</script>");
return;
}
string sqlu = "select userName from userInf where userID='" + userLog + "'";
DataTable dtu;
if (!DB.AF.execSql(sqlu, sqlconnSYS, out dtu))
{
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$.ligerDialog.error(' Failed to get login user information !')</script>");
return;
}
string userName = dtu.Rows[0]["userName"].ToString().Trim();
if (lbtn.ID == "lbtnbj")
{
// edit
sql = "select * from MM_pr_main where djbh='" + djbh + "' and zht=10";
DataTable dt;
if (!DB.AF.execSql(sql, sqlconn, out dt))
{
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$.ligerDialog.error(' error : Failed to access the server , Please try again later !')</script>");
return;
}
if (dt.Rows.Count != 1)
{
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$.ligerDialog.error(' error : The purchase requisition has been operated by others , Please refresh the check !"+djbh+":"+dt.Rows.Count.ToString()+"')</script>");
return;
}
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>window.open('PurchaseApply_Add.aspx?djbh=" + djbh + "&Pr_Type="+pr_type+"')</script>");
//ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$.ligerDialog.error(' error :" + djbh + " : "+dt.Rows.Count.ToString()+"')</script>");
}
}
The main thing is to pass values here :
Then another interface receives :
You don't have to judge , Directly received .
string bjdjbh = "", pr_type = "";
if (Request.QueryString["djbh"] != null)
bjdjbh = Request.QueryString["djbh"].ToString();
if (Request.QueryString["PR_type"] != null)
pr_type = Request.QueryString["PR_type"].ToString();
边栏推荐
- Detailed explanation of TCP communication process (with case code)
- 带你认识一下数仓的分区自动管理
- Automatic invoice processing - get rid of the shackles of paper and data input, automate workflow and exception handling, and significantly shorten the audit preparation time
- This startup wants to see your Ding Ding! They use AI to detect sexual diseases and ensure data anonymity and encryption. Would you like to
- Intel assembly language programming learning - Chapter 5 process - Part 1
- 解决npm 安装 nrm遇到报错问题SyntaxError: Unexpected token import
- PLC的通信模式
- [applet] come and develop your first wechat game (detailed process)
- Winform记住密码功能
- Many people think that the development logic of the metauniverse is consistent with that of the Internet, but I don't think so
猜你喜欢
随机推荐
Yunna | dynamic environment monitoring system inspection, general introduction to the functions of the dynamic environment monitoring system
ASP.NET 学习篇(1)
第二章第三节:字符串常规操作
第二章第十五节:字典的基本操作
【CVA估值训练营】读懂上市公司年报_第二讲
asp.net -编辑超链接事件
Vulnhub靶机-doubletrouble
第二章第二节:字符串 索引和切片
Section 8 of Chapter II: addition, deletion, modification and query of the list
xshell 判断文件超出指定大小则清空文件
Semantic matching of English keyword text splitting
Rasterization comprehensive analysis
DAMA-第九章(文件与内容管理)
Starfish OS:以现实为纽带,打造元宇宙新范式
第二章 第八节:列表的增删改查
Hangzhou dynamic environment monitoring system supplier, dynamic environment monitoring equipment
Web3 traffic aggregation platform starfish OS interprets the "p2e" ecosystem of real business
金融企业出海新兴市场机遇与挑战并存,ADVANCE.AI保障其安全合规发展
项目总结:文件管理系统
Skillfully using roaringbitmap to deal with the memory diff problem of massive data