驯服大丈夫,魏俫,男士脸部皮肤保养
前端js代码:
function myconfirm(message, guid) { if (confirm(message) == true) { document.getelementbyid("hidden1").value = guid; } else { document.getelementbyid("hidden1").value = ""; } //form1.submit(); form1.submit(); }
后台c#代码:
1 /// <summary> 2 /// 用于标识confirm是否继续当前操作 3 /// </summary> 4 public string confirmvalue 5 { 6 get { return viewstate["confirmvalue"] == null ? "" : viewstate["confirmvalue"].tostring(); } 7 set { viewstate["confirmvalue"] = value; } 8 } 9 10 protected void page_load(object sender, eventargs e) 11 { 12 if (!string.isnullorempty(confirmvalue)) 13 { 14 btnsave_click(null, null);//后台弹出确认对话框 15 } 16 if (ispostback) 17 { 18 return; 19 } 20 } 21 22 protected void btnsave_click(object sender, eventargs e) 23 { 24 25 26 if (string.isnullorempty(confirmvalue))//提示 27 { 28 string strguid = guid.newguid().tostring(); 29 confirmvalue = strguid; 30 scriptmanager.registerstartupscript(this, this.gettype(), "_showmessage", "myconfirm('是否继续?','" + strguid + "');", true); 31 return; 32 } 33 if (!string.isnullorempty(confirmvalue) && confirmvalue != hidden1.value)//取消 34 { 35 confirmvalue = ""; 36 //showmessage("提示", "您取消了当前操作"); 37 return; 38 } 39 else//如果点击确认,则需要把confirmvalue初始化为空 40 { 41 confirmvalue = ""; 42 } 43 } 44 45 46 47 48
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论