本文介绍了如何在使用c#重定向到asp.net页面后保留该值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 如何在重定向到页面后保留该值? 我正在检查重复组合服务器端的警报消息。如果存在这样的值,我需要在弹出窗口中显示相同的值。如果在弹出窗口中选中该复选框,则用户必须能够保存数据。否则弹出窗口必须保留在那里。 我不能使用客户端选项,因为在按钮点击时在服务器端完成了其他验证,并且在那里也进行了重复检查。 我尝试了什么: 我将以下信息传递给另一个带复选框的页面覆盖验证。如果选中则需要保存数据,否则弹出应保留在那里。 strDuplicateDDAValidationError = 测试; string qryString = ?DuplicateDDACombinationMessage = + strDuplicateDDAValidationError; if (qryString!= ) { Page.RegisterStartupScript( View_OUT_300_DDA_Duplicate_Validation.aspx , < script language = \javascript \> var answer = window.showModalDialog(\ View_OUT_300_DDA_Duplicate_Validation.aspx + qryString + \,'',\dialogWidth:1000px; dialogHeight:800px; center:yes \);< / script>); return ; } 解决方案 How to retain the value after getting redirected to a page?I am checking for an alert message for a duplicate combination server side. If such a value exists I need to show the same in a pop up window. If the checkbox is checked in the pop up window user must be able to save the data. Else the pop up must remain there.I can't use client side option as there are other validations done in the server side on button click and duplicate checking also done there.What I have tried:I am passing the message as below to another page with checkbox to override the validation. If checked then data needs to be saved else pop up should remain there. strDuplicateDDAValidationError = "test"; string qryString = "?DuplicateDDACombinationMessage=" + strDuplicateDDAValidationError; if (qryString != "") { Page.RegisterStartupScript("View_OUT_300_DDA_Duplicate_Validation.aspx", "<script language=\"javascript\">var answer = window.showModalDialog(\"View_OUT_300_DDA_Duplicate_Validation.aspx" + qryString + "\",'',\"dialogWidth:1000px; dialogHeight:800px; center:yes\");</script>"); return; } 解决方案 这篇关于如何在使用c#重定向到asp.net页面后保留该值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 11-03 15:13