问题描述
嗨
我有一个问题我在没有MVC的情况下使用vb.net进行我的网络应用程序,我想用路由重写网址,但我无法做到在这里工作我有正确的代码我不知道什么时候有人可以帮助我。
I have a problem i using vb.net for my web application without MVC , what i wan is to rewrite the url using route but i cant make it work here the code i have right i not sure what when wrong with it can anyone help me up.
Imports System.Web.Routing
公共类Global_asax
 继承System.Web.HttpApplication
  Sub Application_Start(ByVal sender As Object,ByVal e As EventArgs)
    RegisterRoutes(RouteTable.Routes)
 结束分
 共享子RegisterRoutes(路由为RouteCollection)
      routes.MapPageRoute(" Homepage"," Homepage","〜/ Homepage.aspx")
 结束子
Imports System.Web.Routing
Public Class Global_asax
Inherits System.Web.HttpApplication
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
RegisterRoutes(RouteTable.Routes)
End Sub
Shared Sub RegisterRoutes(routes As RouteCollection)
routes.MapPageRoute("Homepage", "Homepage", "~/Homepage.aspx")
End Sub
以下此代码在页面加载
谢谢
Johnny
推荐答案
https ://msdn.microsoft.com/en-us/library/cc668177.aspx?f = 255& MSPPError = -2147217396
您还可以发布到各个部分,如MVC和ASP.NET论坛中的其他人。
You can also post to various sections like MVC and others in the ASP.NET forum.
http://forums.asp.net/
http://forums.asp.net/
这篇关于我如何在asp.net中路由我的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!