Are there a way to update Text WebParts in a page? #1356
-
Are there a way to update Text WebParts in a page? I've been checking the documentation and I found how to add a text webpart to a page, but I didn't find a way how to edit the text of text webparts in a page. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@mohammadamer : you can cast the control you need to |
Beta Was this translation helpful? Give feedback.
-
As of this update, the banner webpart seems to have introduced some strange behaviour, which seems to have been resolved by updating Pnp Core to 1.14. @jansenbe Is there a way to update the text inside the banner, like you suggested here to set the text property on the IPageText. Tried to use IPageWebPart, but can't seems to figure out how to update the text. |
Beta Was this translation helpful? Give feedback.
@mohammadamer : you can cast the control you need to
IPageText
and then set theText
property. This test (https://github.com/pnp/pnpcore/blob/dev/src/sdk/PnP.Core.Test/SharePoint/PagesTests.cs#L379-L415) shows that, but since it's a test it uses the internal onlyPageText
, you need to useIPageText