TRY I-Expence
Generate Page URL Name for CMS, Blogs Application
For any CMS, Blog application dynamic page creation is one of the way to create pages.
Posted Date: 06 Feb 2008
 

Description

Hi All,

To give the Name to the Page can be handeled by many ways like

  1. Using GUID (Issue- Cant identify exactly while browsing through pages)
  2. Using Session (Issue-Same as above)
  3. Using Page Title provided in Text Field (We will see this)

We are going to implement the scenario 3. We will first see what are our constraints for page url name.

  1. It should be only Alphanumeric enabled like - About-Us.aspx
  2. No other character should include in the page name like - %,@,$ etc

Its just about Regular Expression to identify the alphanumeric characters. The reqular expression is in System.Text.RegularExpressions namespace. 

Regex.Replace(strInput, "[^\\w]", "");

If you give the page Title to - About % US #$ output will be AboutUs.aspx

Happy Coding :)

 
Complete IT Solutions
Sign up for PayPal and start accepting credit card payments instantly.


Copyright © 2006-07 Pritam Baldota
Rights reserved. Please seek permission for reproduction.