Rewrite url di asp.net

Selamat malam agan agan, ane baru pertama kali coba asp.net, bikin crud simple, dan sedikit bingung dibagian rewrite url. Sebenernya si baik baik aja, cuman ane mau tanya mengatur default page not found dan error ke index, jika request path pada url tidak ada. dengan kata lain, tidak ada keterangan page not found atau page error, langsung saja jika ada not found / error dialihkan kehalaman utama. berikut codenya
//routerConfig
using System;
using System.Web;
using System.Web.Routing;

namespace asp.net_crud.router
{
	public class routerConfig
	{
		public routerConfig ()
		{
		}
		public static void registerRoutes(RouteCollection routes)
		{
			routes.MapPageRoute("index", "", "~/index.aspx");
			routes.MapPageRoute("user", "user", "~/index.aspx");
		}
	}
}
//global asax
namespace asp.net_crud
{
	using System;
	using System.Collections;
	using System.ComponentModel;
	using System.Web;
	using System.Web.SessionState;

	using System.Web.Routing;
	using asp.net_crud.router;

	public class Global : System.Web.HttpApplication
	{
		
		protected void Application_Start (Object sender, EventArgs e)
		{
			routerConfig.registerRoutes(RouteTable.Routes);
		}

		protected void Session_Start (Object sender, EventArgs e)
		{
		}

		protected void Application_BeginRequest (Object sender, EventArgs e)
		{
		}

		protected void Application_EndRequest (Object sender, EventArgs e)
		{
		}

		protected void Application_AuthenticateRequest (Object sender, EventArgs e)
		{
		}

		protected void Application_Error (Object sender, EventArgs e)
		{
		}

		protected void Session_End (Object sender, EventArgs e)
		{
		}

		protected void Application_End (Object sender, EventArgs e)
		{
		}
	}
}
di bagian user register oke uc?export=view&id=19N1jkngzTK4Zvco15c_awEXqiuk9LLKP dan ketika di isi path yang ngasal uc?export=view&id=1hjb86oKGdQaXXtDgg3iw5acfkYg_XktA udah mentok cari tutor bahasa planet :( :( :( mohon bantuannya dan thank's gan :)
avatar momoji

@momoji

108 Kontribusi 44 Poin

Login untuk menanggapi


Jawaban

Belum ada Jawaban, jadi yang pertama

Login untuk gabung berdiskusi