Public Class Global
Inherits System.Web.HttpApplication
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container
End Sub
Sub Application_OnBeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Dim myHttpContext As HttpContext = HttpContext.Current
Dim nonStaticUrl As String = myHttpContext.Request.Path.ToLower()
Dim i As Integer = nonStaticUrl.IndexOf("prodotti")
If i <> -1 Then
Dim j As Integer = nonStaticUrl.IndexOf(".aspx")
Dim codiceprodotto As String = nonStaticUrl.Substring(i + 8, j - (i + 8))
myHttpContext.RewritePath("prodotti.aspx?codiceprodotto=" + codiceprodotto)
End If
End Sub
End Class