Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class HomeController
- Inherits System.Web.Mvc.Controller
- Function Index(ByVal IdIn As String, ByVal PathIn As String) As ActionResult
- Dim PathParsed As String = ""
- Dim FileName As String = ""
- Dim ViewPath As String = ""
- If IdIn = "" Then Return View("~/views/home/index.vbhtml")
- If PathIn <> "" Then
- PathParsed = PathIn.ToLower
- If PathParsed.EndsWith("/") = True Then PathParsed = PathParsed.Substring(1, PathParsed.Length - 1)
- End If
- Select Case IdIn.ToLower
- Case "about"
- If PathIn = "" Then FileName = IdIn
- End Select
- If FileName <> "" Then ViewPath = "~/views/home/" & FileName & ".vbhtml"
- If ViewPath = "" Then
- Return HttpNotFound()
- Else
- Return View(ViewPath)
- End If
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement