0

私はオンラインでいくつかのチュートリアルに従いましたが、それらはすべて、ASP.net Web フォームを使用した .net ルーティングの同じロジックを示しているようです。以下の URL を実行すると、404 エラーが発生します。Test.aspx は、このアプリケーションのルート フォルダーにあります。

http://www.mydomain.com/member/abc

ここに私のglobal.asaxの内容があります:


<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>

<script runat="server">

    void RegisterRoutes(RouteCollection routes)
    {
        routes.MapPageRoute(
            "TestABC",
            "member/{name}",
            "~/Test.aspx");
    }               

    void Application_Start(object sender, EventArgs e) 
    {
        RegisterRoutes(RouteTable.Routes);
    }

    void Application_End(object sender, EventArgs e) 
    {
        //  Code that runs on application shutdown

    }

    void Application_Error(object sender, EventArgs e) 
    {

    }

    void Session_Start(object sender, EventArgs e) 
    {
        // Code that runs when a new session is started

    }

    void Session_End(object sender, EventArgs e) 
    {
        // Code that runs when a session ends. 
        // Note: The Session_End event is raised only when the sessionstate mode
        // is set to InProc in the Web.config file. If session mode is set to StateServer 
        // or SQLServer, the event is not raised.

    }

</script>

web.config ファイルで何かする必要がありますか?

どんな助けでも大歓迎です。

4

1 に答える 1