The URL that you are creating doesn’t exceed 255 characters. This
is because the Hyperlink type column in SharePoint does not accept more
than 255 characters as an URL. This is what had happened personally to
me . Had a pretty tough time figuring it out myself.
Check that your URL is well-formed. To check this, try to browse the
URL, that you are generating, in IE and see whether it points to your
desired target. Just Copy paste the URL generated to the Address bar of
IE and press enter. Ideally this should open the page you are trying to
link to. If it is not then you instantly know that what you are
generating is wrong. Correct it!
You may get the URL generated runtime from inside your Code by
logging it into the Event Log or just by redirecting it to a text file
or invoking IE by passing the URL generated as a parameter.
If you are directly assigning the value to the column like:
Item[""] = “,”, then check that you are not missing the after the comma.
The best possible way to do it I feel is in this way:
| SPFieldUrlValue yourURL = new SPFieldUrlValue(); |
| yourURL.Url = ""; // For example: www.microsoft.com. |
| yourURL.Url = yourURL.Url.Replace(" ", "%20"); // This is however optional. |
| yourURL.Description = ""; // eg:Microsoft. | | | | | | | | | | | |
Source : Sharepoint-insight