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

时间:2011-03-21 13:30:04

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

我正在使用Response.Redirect()将数据(包含HTML)从一个页面传递到另一个页面。这在谷歌浏览器中运行良好,但在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="

3 个答案:

答案 0 :(得分:3)

查询字符串的长度太长。 I.E.最多只能接受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跨页面传输大量数据。

答案 1 :(得分:1)

试试这个

string value = "../containing html";
Response.Redirect("http://www.mysite.com/?Value=" + Server.UrlEncode(value));

答案 2 :(得分:1)

HTTP获取长度,Google Chrome和Internet Explorer支持的不同。

  • IE仅支持 2083 个字符。
  • Google Chrome支持 8182 个字符。
  • Safari浏览器支持80,000。
  • Opera Browser支持190,000。