sharepoint web部分中的多行文本框

时间:2009-03-12 12:03:43

标签: c# sharepoint web-parts

如何在sharepoint webpart中显示多行文本框的字段?

当我点击webpart上的“修改共享webpart”时,我希望文本字段给我一个多行框

感谢

2 个答案:

答案 0 :(得分:5)

这样的东西
var textBox = new TextBox();
textBox.TextMode = TextBoxMode.MultiLine;

答案 1 :(得分:2)

您还必须将渲染编写为对您所处的模式敏感:

if( (WebPartManager.DisplayMode == WebPartManager.DesignDisplayMode) || 
    (WebPartManager.DisplayMode == WebPartManager.EditDisplayMode) ) {
       //Show your textbox
} else {
       //Render as text
}