我正在使用aspx Web Server Pro,并且我所有的UltiDev文件都位于一个'WebForms‘子文件夹中。
我希望能够默认将所有页面请求放到此文件夹中,以便他们只需键入:http://myserver/somepage.aspx而不是
http://myserver/WebForms/somepage.aspx。
这个是可能的吗?
编辑:
下面是该解决方案的VB.NET版本,其中包括区分大小写的检查:
If Not HttpContext.Current.Request.Path.ToUpper.Contains("/WEBFORMS/") Then
你好。我需要在一个斜杠中替换双斜杠。我计划在Global.asax Application_BeginRequest事件中这样做。够了吗?或者最好是做一个http模块?谢谢。
UPD
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
' Fires at the beginning of each request
Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(AppSettin
Server Error in '/' Application.
--------------------------------------------------------------------------------
No parameterless constructor defined for this object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack tra
是否有一种方法可以重写显示不同视图的路径,而不是RedirectToAction或重定向?我不想改变url,但是注意常规的RewritePath不能被“返回”,所以这个动作实际上一直在跟踪它!
public ActionResult Register(){
if (somehting){
HttpContext.RewritePath(url);
// I want it to stop here, somehow, but it keeps going and expects a return statement
}
return Vi