0

I created a new SP 2010 List of Hyperlinks using the SP2010 Hyperlinks List Template. It works so long as the hyperlinks/URL contains no spaces. When viewing the list one can click on any link and be taken to the specified URL. When the hyperlink contains a space such as is the case with some network directories like \\FileServer\Manuals\Docs & Guides\ The SP list considers the hyperlink to be only the part up until the first space. When viewing the list and clicking on an entry with a space in the URL you are taken to the incorrect location. How di I get the URL column of the SP210 List to treaty to full hyperlink as the hyperlink and not just the portion up until the first space?

How can I add the below URL/Hyperlink to the list so that when someone is viewing the list and they click on the hyperlink they will be taken to the location listed below?

\\FileServer\Manuals\Docs & Guides\

2 Answers 2

0

You can try to replace the space with %20

so your link should look like this:

\FileServer\Manuals\Docs%20&%20Guides\

In c#:

"someString".Replace(" ", "%20");

I do the same with normal URL and it works like a charm.

cheers Jürgen

2
  • Thanks Jurgen. This is the asnwer i needed. How to add the URL not programatically but copy & paste or just manually typing it in. This is a list of URLs & Shortcuts for all our users to make use of and add to. Commented Mar 11, 2013 at 20:07
  • I'm glad I could help. :) Commented Mar 12, 2013 at 7:05
0

For your url I would recommend removing the space or %20 you can use this that iv just made. pass the url string that you need to remove and it will return the url string without any spaces :)

    public static string RemoveURLSpaces(string url)
    {
        url = url.Replace(" ", "");

        return url;
    }

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.