Skip to main content
formatting and wording.
Source Link
Paul Strupeikis
  • 3.8k
  • 4
  • 21
  • 33

You can set it like this:

oListItem["URL"] = String.Format("{0}, {1}", mainurl, "Description");

It's a simple string, where and URL value is followed by a description which isare separated by a comma.

Or you can use a more object oriented approach:

var value = new SPFieldUrlValue(mainurl);
value.Description = "Description";
oListItem["URL"] = value;

Whichever suits you :)

You can set it like this:

oListItem["URL"] = String.Format("{0}, {1}", mainurl, "Description");

It's a simple string, where URL is followed by a description which is separated by a comma.

Or you can use a more object oriented approach:

var value = new SPFieldUrlValue(mainurl);
value.Description = "Description";
oListItem["URL"] = value;

Whichever suits you :)

You can set it like this:

oListItem["URL"] = String.Format("{0}, {1}", mainurl, "Description");

It's a simple string and URL value is followed by a description which are separated by a comma.

Or you can use a more object oriented approach:

var value = new SPFieldUrlValue(mainurl);
value.Description = "Description";
oListItem["URL"] = value;

Whichever suits you :)

Source Link
Paul Strupeikis
  • 3.8k
  • 4
  • 21
  • 33

You can set it like this:

oListItem["URL"] = String.Format("{0}, {1}", mainurl, "Description");

It's a simple string, where URL is followed by a description which is separated by a comma.

Or you can use a more object oriented approach:

var value = new SPFieldUrlValue(mainurl);
value.Description = "Description";
oListItem["URL"] = value;

Whichever suits you :)