简单的url重写,静态化前身,在global.asa中的begin_request事件中添加
protected void Application_BeginRequest(Object sender, EventArgs e) { string url = Request.AppRelativeCurrentExecutionFilePath;//"~/play_15.aspx" Match match = Regex.Match(url, @"~/Play_(\d+).aspx"); if (match.Success) { int id = Convert.ToInt32(match.Groups[1].Value); Context.RewritePath("play.aspx?id=" + id); } }
时间: 2024-10-15 20:03:10