Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs when a new session is started Dim urldata() As String Dim casturl As String Dim str As String str = Request.RawUrl.ToString If str.EndsWith(".aspx") Then Exit Sub End If If Not str.EndsWith(".html") Then urldata = Split(str, "=") casturl = urldata(urldata.Length - 1).ToString() Dim con As New SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings("abc").ConnectionString) Dim cmd As New SqlCommand con.Open() cmd.CommandType = Data.CommandType.Text cmd.CommandText = "select catName from pqr where catId IN(select parentId from categories where catId IN(select categoryId from registerdata where navTag='" & casturl & "'))" cmd.Connection = con Dim geturl As String geturl = Convert.ToString(cmd.ExecuteScalar) Response.Redirect("http://www.example.com/ads-" & Trim(geturl) & "/" & Trim(casturl) & ".html") End If End Sub
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) { // your codes here }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)