Skip to main content
added 215 characters in body; edited tags
Source Link
KidBatman
  • 381
  • 4
  • 19

enter image description here Clicking this button in the list's ribbon, I can properly embed HTML so SharePoint doesn't strip anything out.

I have some HTML that I need to insert into a list item field via C# code. How do I simulate the Embed Code ribbon functionality via C#?

So imagine i'm doing something:

listItem["Body"] = "HTML String"; 

How do I "Embed" "HTML string" before I insert it?

UPDATE

My apologies, I failed to mention that listItem["Body"] is the body field of a discussion board. Users should still be allowed to manually contribute to the discussion outside of my C# entries.

enter image description here Clicking this button in the list's ribbon, I can properly embed HTML so SharePoint doesn't strip anything out.

I have some HTML that I need to insert into a list item field via C# code. How do I simulate the Embed Code ribbon functionality via C#?

So imagine i'm doing something:

listItem["Body"] = "HTML String"; 

How do I "Embed" "HTML string" before I insert it?

enter image description here Clicking this button in the list's ribbon, I can properly embed HTML so SharePoint doesn't strip anything out.

I have some HTML that I need to insert into a list item field via C# code. How do I simulate the Embed Code ribbon functionality via C#?

So imagine i'm doing something:

listItem["Body"] = "HTML String"; 

How do I "Embed" "HTML string" before I insert it?

UPDATE

My apologies, I failed to mention that listItem["Body"] is the body field of a discussion board. Users should still be allowed to manually contribute to the discussion outside of my C# entries.

Source Link
KidBatman
  • 381
  • 4
  • 19

SSOM Embed Code when inserting list item

enter image description here Clicking this button in the list's ribbon, I can properly embed HTML so SharePoint doesn't strip anything out.

I have some HTML that I need to insert into a list item field via C# code. How do I simulate the Embed Code ribbon functionality via C#?

So imagine i'm doing something:

listItem["Body"] = "HTML String"; 

How do I "Embed" "HTML string" before I insert it?