<%#If(Eval("PlanTitle") = "Free", "
", "
Website")%>
In global page(vb code)
Imports System.Web.SessionState
Imports System.IO
Public Class Global_asax
Inherits System.Web.HttpApplication
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
End Sub
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
' Fires at the beginning of each request
Dim physicalPathVar As String = Request.PhysicalPath.ToString()
'Response.Write(physicalPathVar + " - in Index");
'return;
If File.Exists(physicalPathVar) Then
' Do nothing here, just serve the file
'Response.Write(physicalPathVar + " - in Else part 0");
' If the file does not exist then
ElseIf Not File.Exists(physicalPathVar) Then
'Response.Write(physicalPathVar + " - in Else part 1");
' Get the URL requested by the user
Dim sRequestedURL As String = Request.Path
Dim sTargetURL As String = ""
If sRequestedURL.Contains("business/") Then
Dim _location As Integer = sRequestedURL.LastIndexOf("/")
sRequestedURL = sRequestedURL.Substring(_location + 1)
' check if the URL is well formed
'*********** Sonu testing *end ***************
sTargetURL = Me.convertRssURL(sRequestedURL)
Else
' as more modules are added so will the checks here
'Response.Write(physicalPathVar + " - in Else part 4");
sTargetURL = "Default.aspx"
End If
'Response.Write(physicalPathVar + " - in Else part 5");
Context.RewritePath(sTargetURL, False)
'Response.Write(physicalPathVar + " - in Else part 6");
End If
End Sub
Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
' Fires upon attempting to authenticate the use
End Sub
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
End Sub
Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application ends
End Sub
Public Function convertRssURL(ByVal URLToProcess As String) As String
Dim finalURL As String = ""
If URLToProcess.Length > 0 Then
finalURL = "~/ViewExternalWebSite.aspx?id=" + URLToProcess
Else
finalURL = "/"
End If
Return finalURL
End Function
End Class
My original url -: ViewWebsite.aspx?id=41
i have completed change url
ViewWebsite.aspx?id=41 to
business/username/41
But now any other link click in this page then exception why?
My url has been caught (business)