c# - 为什么 Response.Redirect() 在 Chrome 中有效,但在 IE 中无效?

标签 c# asp.net internet-explorer iis google-chrome

我正在使用 Response.Redirect() 将数据(包含 HTML)从一个页面传递到另一个页面。这在 Google Chrome 中运行良好,但在 Internet Explorer 中显示:“找不到页面!”

有人知道这是什么吗?

提前致谢

这是网址:

string url = "Detailscherm.aspx?"
            + "melder=" + Server.UrlEncode(gv.SelectedRow.Cells[1].Text)
            + "&onderwerp=" + Server.UrlEncode(gv.SelectedRow.Cells[2].Text)
            + "&omschrijving=" + Server.UrlEncode(lblOmschrijving.Text)
            + "&fasedatum=" + Server.UrlEncode(gv.SelectedRow.Cells[4].Text)
            + "&outlookid=" + Server.UrlEncode(lblOutlookID.Text)
            + "&status=" + Server.UrlEncode(status)

            + "&niv1=" + Server.UrlEncode("")
            + "&niv2=" + Server.UrlEncode("");



Response.Redirect(url);

lblOmschrijving 是一个包含 HTML 代码的标签

这是重定向前的 URL 值:

"Detailscherm.aspx?melder=EBE&onderwerp=Test+feedback&omschrijving=%3chtml+xmlns%3ao%3d%22urn%3aschemas-microsoft-com%3aoffice%3aoffice%22+xmlns%3aw%3d%22urn%3aschemas-microsoft-com%3aoffice%3aword%22+xmlns%3d%22http%3a%2f%2fwww.w3.org%2fTR%2fREC-html40%22%3e%0d%0a%3chead%3e%0d%0a%3cmeta+http-equiv%3d%22Content-Type%22+content%3d%22text%2fhtml%3b+charset%3dutf-8%22%3e%0d%0a%3cmeta+name%3d%22Generator%22+content%3d%22Microsoft+Word+11+(filtered+medium)%22%3e%0d%0a%3cstyle%3e%0d%0a%3c!--%0d%0a+%2f*+Style+Definitions+*%2f%0d%0a+p.MsoNormal%2c+li.MsoNormal%2c+div.MsoNormal%0d%0a%09%7bmargin%3a0cm%3b%0d%0a%09margin-bottom%3a.0001pt%3b%0d%0a%09font-size%3a12.0pt%3b%0d%0a%09font-family%3a%22Times+New+Roman%22%3b%7d%0d%0aa%3alink%2c+span.MsoHyperlink%0d%0a%09%7bcolor%3ablue%3b%0d%0a%09text-decoration%3aunderline%3b%7d%0d%0aa%3avisited%2c+span.MsoHyperlinkFollowed%0d%0a%09%7bcolor%3apurple%3b%0d%0a%09text-decoration%3aunderline%3b%7d%0d%0aspan.E-mailStijl17%0d%0a%09%7bmso-style-type%3apersonal-compose%3b%0d%0a%09font-family%3aArial%3b%0d%0a%09color%3awindowtext%3b%7d%0d%0a%40page+Section1%0d%0a%09%7bsize%3a595.3pt+841.9pt%3b%0d%0a%09margin%3a70.85pt+70.85pt+70.85pt+70.85pt%3b%7d%0d%0adiv.Section1%0d%0a%09%7bpage%3aSection1%3b%7d%0d%0a--%3e%0d%0a%3c%2fstyle%3e%0d%0a%3c%2fhead%3e%0d%0a%3cbody+lang%3d%22NL%22+link%3d%22blue%22+vlink%3d%22purple%22%3e%0d%0a%3cdiv+class%3d%22Section1%22%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3eMohamed%2c%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3e%3co%3ap%3e%26nbsp%3b%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3eIk+heb+zonet+enkele+zaken+getest.+De+testfeedback+is+opgenomen+in+de+bijlage.%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3e%3ca+href%3d%22file%3a%2f%2f%2f%5c%5cJUPITER%5cInformatica%5cProjecten%5cIntegratie%2520SLA%2520rapportering%2520op%2520IT%2520Helpdesk%2520mailbox%5c6.%2520Test%2520en%2520Training%5cTesten%2520Integratie%2520helpdesk%2520sla-%2520Opmerkingen.xls%22%3eO%3a%5cProjecten%5cIntegratie%0d%0a+SLA+rapportering+op+IT+Helpdesk+mailbox%5c6.+Test+en+Training%5cTesten+Integratie+helpdesk+sla-+Opmerkingen.xls%3c%2fa%3e%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3e%3co%3ap%3e%26nbsp%3b%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3eWe+zullen+hier+vanmiddag+samen+naar+kijken.%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3e%3co%3ap%3e%26nbsp%3b%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3eGroeten%2c%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3e%3co%3ap%3e%26nbsp%3b%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3eEric%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%222%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3b%0d%0afont-family%3aArial%22%3e%3co%3ap%3e%26nbsp%3b%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a9.0pt%3b%0d%0afont-family%3aArial%3blayout-grid-mode%3aline%22%3e__________________________________________%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Times+New+Roman%22%3e%3cspan+style%3d%22font-size%3a%0d%0a9.0pt%3blayout-grid-mode%3aline%22%3e%3co%3ap%3e%26nbsp%3b%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a9.0pt%3b%0d%0afont-family%3aArial%3blayout-grid-mode%3aline%22%3eEric+Op+de+Beeck%3c%2fspan%3e%3c%2ffont%3e%3cspan+style%3d%22layout-grid-mode%3aline%22%3e%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a9.0pt%3b%0d%0afont-family%3aArial%3blayout-grid-mode%3aline%22%3eAfdelingshoofd+Informatica%3c%2fspan%3e%3c%2ffont%3e%3cfont+size%3d%222%22%3e%3cspan+style%3d%22font-size%3a10.0pt%3blayout-grid-mode%3aline%22%3e%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a9.0pt%3b%0d%0afont-family%3aArial%3blayout-grid-mode%3aline%22%3e%3ca+href%3d%22mailto%3aEric.Op.de.Beeck%40etaplighting.com%22+title%3d%22mailto%3aEric.Op.de.Beeck%40etaplighting.com%22%3eEric.Op.de.Beeck%40etaplighting.com%3c%2fa%3e%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Times+New+Roman%22%3e%3cspan+style%3d%22font-size%3a%0d%0a9.0pt%3blayout-grid-mode%3aline%22%3e%3co%3ap%3e%26nbsp%3b%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a9.0pt%3b%0d%0afont-family%3aArial%3blayout-grid-mode%3aline%22%3eAntwerpsesteenweg+130+-+B-2390+Malle%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a9.0pt%3b%0d%0afont-family%3aArial%3blayout-grid-mode%3aline%22%3eTel.+03+310+02+11+-+Fax+03+311+61+42%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+lang%3d%22EN-GB%22+style%3d%22font-size%3a%0d%0a9.0pt%3bfont-family%3aArial%3bletter-spacing%3a.5pt%3blayout-grid-mode%3aline%22%3eBTW+BE+0424+980+655+RPR+Antwerpen%3c%2fspan%3e%3c%2ffont%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+lang%3d%22EN-GB%22+style%3d%22font-size%3a9.0pt%3bfont-family%3aArial%3blayout-grid-mode%3aline%22%3e%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cu%3e%3cfont+size%3d%221%22+color%3d%22blue%22+face%3d%22Arial%22%3e%3cspan+lang%3d%22EN-GB%22+style%3d%22font-size%3a9.0pt%3bfont-family%3aArial%3bcolor%3ablue%3blayout-grid-mode%3aline%22%3ewww.etaplighting.com%3c%2fspan%3e%3c%2ffont%3e%3c%2fu%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+lang%3d%22EN-GB%22+style%3d%22font-size%3a9.0pt%3bfont-family%3aArial%3b%0d%0alayout-grid-mode%3aline%22%3e%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a9.0pt%3b%0d%0afont-family%3aArial%3blayout-grid-mode%3aline%22%3e__________________________________________%3c%2fspan%3e%3c%2ffont%3e%3cfont+size%3d%221%22+face%3d%22Arial%22%3e%3cspan+style%3d%22font-size%3a9.0pt%3bfont-family%3aArial%3blayout-grid-mode%3a%0d%0aline%22%3e%3co%3ap%3e%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3cp+class%3d%22MsoNormal%22%3e%3cfont+size%3d%223%22+face%3d%22Times+New+Roman%22%3e%3cspan+style%3d%22font-size%3a%0d%0a12.0pt%22%3e%3co%3ap%3e%26nbsp%3b%3c%2fo%3ap%3e%3c%2fspan%3e%3c%2ffont%3e%3c%2fp%3e%0d%0a%3c%2fdiv%3e%0d%0a%3c%2fbody%3e%0d%0a%3c%2fhtml%3e%0d%0a&fasedatum=21%2f03%2f2011+12%3a08%3a13&outlookid=AAMkAGI2MGM0NjY2LTI5MGYtNGVmMC1iMTg2LThlZDNmODFhZDIwNQBGAAAAAAC5W4YdHHPkSL1VgU1WnUztBwD2It7i8bOLTI4%2fH%2bc6MwEsAC0BCIilAAD2It7i8bOLTI4%2fH%2bc6MwEsAC0M%2b0T9AAA%3d&status=0&niv1=&niv2="

最佳答案

查询字符串的长度太长。 IE。最多只接受 2083 个字符。 Chrome 和其他人没有。我遇到过类似的问题。

尝试使用 Server.Transfer(),或将变量放入 session 或发布 form

Session["melder"] = Server.UrlEncode(gv.SelectedRow.Cells[1].Text);
Session["onderwerp"] = Server.UrlEncode(gv.SelectedRow.Cells[2].Text);
...

Response.Redirect("Detailscherm.aspx");

然后您可以在该页面上取回这些值

string melder = Session["melder"];
Session["melder"] = "";

在任何情况下,将所有数据都放在查询字符串中似乎不是一个好主意。如果有人更改地址栏中的值,可能会使您的页面显示不正确的数据。

尝试使用 sessionsPost 跨页面传输大量数据。

关于c# - 为什么 Response.Redirect() 在 Chrome 中有效,但在 IE 中无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5378248/

相关文章:

java - 如何重用略有不同的代码

c# - 如何存储 linq 查询?

c# - 如何以编程方式向 contentPlaceHolder 添加内容?

ASP.NET MVC 4 - 应用程序不接受新的连接字符串 - AppHarbor 部署问题

javascript - 通过 Jquery/JS/浏览器特定 API 捕获打印事件

javascript - 当在 IE11 的 URL 字段中按下 Ctrl 时,jQuery keydown 处理程序接收 keydown 事件

c# - 使用 .NET 检索 Windows DHCP 服务器列表和每个 DHCP 服务器的范围信息

javascript - 使用 C# 在客户端转换为本地时间

css - 任何人都可以让这个 CSS 工作吗

c# - 当我尝试加入 2 个数据表时,对象引用未设置为对象的实例