Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Friendly url with an ampersand &Friendly url with an ampersand &
Previous
 
Next
New Post
11/19/2007 4:52 PM
 

Hi,

I am building friendly urls, however, if the data to be added to the url is like Bens & Jerry's I get default.aspx?keyword=bens&Jerry's instead of /keyword/bens&Jerry's/default.aspx

Can somebody tell me how to avoid this?

J.

 
New Post
11/19/2007 7:53 PM
 

You need to UrlEncode your text before you put it into a URL

Dim myString as string = System.Web.HttpUtility.UrlEncode("bens&Jerry's")     

Which will convert "bens&Jerry's"   to  "bens%26Jerry%27s"

Which in turn would give a friendly URL that looks like:

/keyword/bens%26Jerry%27s/default.aspx

Westa

 
New Post
11/24/2007 5:59 PM
 

Hi,

Seems that in that case the url is always like : default.aspx?bens%26Jerry%27s and the url friendly urls are not there anymore. like: ben+jerry/default.aspx

Please advice. Maybe only thing to do is only allow alphanumeric data? But how to do that in a efficient way?

J.

 
New Post
11/27/2007 7:13 PM
 

Hi I have next result, but it does not resolve to a correct URL in DNN. It seems the querystring is not detected if I add one.

Champ+/%20Ben%20bidon/Default.aspx

I would like to get something like:

Champ-Ben-bidon/Default.aspx

How can I do that in a FAST way ? string.Replace(" seems slow to me if you have many url's to rewrite. Please advice. Actually all non-alphanumeri characters have to get out and replaced by -

J.

 
New Post
12/1/2007 8:45 AM
 

The solution is next: rawurl =

Regex.Replace(rawurl, "[(?+\\/<>.,@#%& )*-]+", "-", RegexOptions.Compiled);

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Friendly url with an ampersand &Friendly url with an ampersand &


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out