SPS 2003中的儿童WebParts [英] Child WebParts in SPS 2003

查看:62
本文介绍了SPS 2003中的儿童WebParts的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SharePoint 2003.我正在使用(使用C#)

现有的webpart作为子控件(服务器控件)。

我需要访问/在将控件渲染到页面之前,操纵控件

输出的HTML。

控件以单列表格式输出列表。我需要访问行的内容并输出

,并以我自己的表格格式限制。有没有人

有任何操作服务器的HTML

控件的例子,然后再渲染到页面或使用现有的

webparts作为孩子webparts增强功能?


谢谢你,

倒钩

解决方案

嗨Barbara,


感谢您使用Microsoft新闻组。

我的名字是Jeffrey,我已经审核了您的帖子,我会做一些关于这个问题的研究。

我会尽快回复你。感谢您的理解。


祝你好运,

Jeffrey Tan

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证,也没有授予权利




嗨芭芭拉,


感谢您的等待。

我会问一些熟悉Share Point的同事来帮助你。$ / b
感谢您的理解。


祝你好运,

Jeffrey Tan

微软在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证也没有授予任何权利。


嗨芭芭拉,

如果你在谈论任何服务器控件(比如datagrid),你这个
可以将控件呈现给你自己的HTMLwriter,然后抓取HTML

吧。


类似的东西:


private void Button1_Click(object sender,System.EventArgs e)

{

//this.Controls。添加(localgrid);

System.IO.StringWriter oSW = new System.IO.StringWriter();

HtmlTextWriter oWriter = new HtmlTextWriter(oSW);

localgrid.RenderControl(oWriter);

Response.Write(oSW.ToString());


}

但是如果你的孩子控件是webpart,那么webpart'不会在RenderControl方法中呈现他们的

HTML,而是渲染RenderWebPart方法。你必须看到你想要添加的webpart允许你使用

RenderWebPart方法(因为webpart框架调用那个方法

)适当地)..


无论如何,如果你试图使用ListView webpart作为你的孩子

控制,那么RenderWebPart方法就是密封的,你不会

能够使用它。相反,使用Sharepoint对象模型进入

列表视图,然后从SPView对象中取出RenderASHTML方法,以

将视图呈现为HTML。

希望这会有所帮助。

-Thanks

Rahul Sakdeo

Microsoft Sharepoint支持。


I am working with SharePoint 2003. I am using (using C#)
an existing webpart as a child control (server control).
I need to access/manipulate the HTML that the control
outputs prior to rendering it to the the page. The
control outputs a list in a one-column table format. I
need to access the contents of the rows and output them
with restrictions in my own table format. Does anyone
have any examples of manipulating the HTML of a server
control prior to rendering it to a page or using existing
webparts as child webparts to enhance the functionality?

Thank-you,
Barb

解决方案

Hi Barbara,

Thanks for using Microsoft newsgroup.
My name is Jeffrey, I have reviewed your post, I will do some reseach on this issue.
I will reply to you ASAP. Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights



Hi Barbara,

Thanks for your waiting.
I will ask some colleague of mine who is familiar with Share Point to help
you.
Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Hi Barbara ,
if you are talking about any of the server controls (like datagrid ) , you
can render the control to a your own HTMLwriter , and grab the HTML out
of it .

Something like :

private void Button1_Click(object sender, System.EventArgs e)
{
//this.Controls.Add(localgrid);
System.IO.StringWriter oSW = new System.IO.StringWriter();
HtmlTextWriter oWriter = new HtmlTextWriter(oSW);
localgrid.RenderControl(oWriter);
Response.Write(oSW.ToString());

}
but if your child control is a webpart , then webpart''s don''t render their
HTML in RenderControl method , but a RenderWebPart method . You have to
see that which ever webpart you are trying to add allows you to use
RenderWebPart method (cause webpart framework calls that method
approptiatly) ..

In anyways , if you are trying to use the ListView webpart as your child
control , there RenderWebPart method off of that is sealed and you will not
be able to use it . Instead , use the Sharepoint object Model to get to a
list view and then uder the RenderASHTML method off the SPView object to
render a the view as HTML .
Hope this helps.
-Thanks
Rahul Sakdeo
Microsoft Sharepoint Support.


这篇关于SPS 2003中的儿童WebParts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆