ASP.NET

Parsing A Few Characters in A String – VB.Net

Posted by on June 21, 2011 at 3:37 pm

If you need to parse just a few characters from a string, you can easily do that in the code-behind like this: MyVariable = VariableName.Substring(1,3) This gets the first through the third character in the string and places it in MyVariable. Note that the starting position of the variable is 0 so the true first [...]

Getting The Current File Name in Vb.Net

Posted by on June 7, 2011 at 9:19 am

Some times you need to figure out what the actual file name is a the web page that you are on.  If this is the case, here is the easy way to do this in the code behind: Dim myPage As String = System.IO.Path.GetFileName(System.Web.HttpContext.Current.Request.Url.AbsolutePath) If you are on a page, myPage will have just the [...]

Changing ShowStartNode or StartNodeOffset For Sitemap In Code Behind

Posted by on June 7, 2011 at 9:15 am

Sometimes you may want to change the ShowStartNode or StartNodeOffset for your sitemap file when the page is loaded in vb.net. One example is if you are using the web.sitemap file to display an asp:menu on your page. There may be certain pages that you want to show from the starting node and other times [...]