Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从ASP.NET中的404页重定向到另一页_Asp.net_Redirect - Fatal编程技术网

从ASP.NET中的404页重定向到另一页

从ASP.NET中的404页重定向到另一页,asp.net,redirect,Asp.net,Redirect,我有一个定制的404页面,配置了responseMode=“ExecuteURL” 我还有一个母版页,里面有一个搜索框。 提交搜索框后,页面将重定向到/search.aspx?q= 但是,如果我在自定义404页面上,重定向将不起作用。 我在url中得到类似的内容 http://localhost:49321/nothere?error=404&404%3bhttp%3a%2f%2flocalhost%3a49321%2fnothere http://localhost:49321/nothere

我有一个定制的404页面,配置了
responseMode=“ExecuteURL”
我还有一个母版页,里面有一个搜索框。 提交搜索框后,页面将重定向到
/search.aspx?q=
但是,如果我在自定义404页面上,重定向将不起作用。 我在url中得到类似的内容

http://localhost:49321/nothere?error=404&404%3bhttp%3a%2f%2flocalhost%3a49321%2fnothere

http://localhost:49321/nothere
是我测试自定义404页面的url

如果将响应模式设置为
重定向
,它就可以正常工作,但我不希望这样

怎么解决这个问题

这里是为搜索框呈现的html

<div id="searchPanel" onkeypress="javascript:return WebForm_FireDefaultButton(event, &#39;searchButton&#39;)">

                    <input name="ctl00$searchBox" type="text" id="searchBox" placeholder="     Search..." />
                    <input type="submit" name="ctl00$searchButton" value="" id="searchButton" style="display: none" />


</div>


您的搜索框表单是如何实现的?请向我们展示呈现的HTML。@Dai有一个按钮,单击它将调用master.cs中的函数。我在搜索框中包含了呈现的html