Asp.net 2.0 WebPart使用经验点滴


这几天学习使用WebPart,发现众多问题,使用点滴记录如下,同各位共享:
1、WebPart的使用必须基于一个通过身份验证的用户会话。
2、WebPart的使用的个性化应用于所有人的选项默认是禁用的,可以通过修改Web.config来完成
<webParts>
   <personalization>
          <authorization>
             <allow users="*" verbs="enterSharedScope" />
          </authorization>
      </personalization>
    </webParts>
3、WebPart 默认使用页面的 URL 存储个性化数据.但是不包含 querystrings,现在要实现在通用的页面(模版)来实现简单的门户系统,通过不同的querystrings来读取个人,部门等的数据。这样个人自己设定的设定可以直接和别人共享。这样的需求在现有的WebPart系统上无法实现,在WebPart Components for Asp.net 2.0: Workspace home URL:http://www.gotdotnet.com/workspaces/workspace.aspx?id=65fa26c3-a62a-49d6-895d-422272e53a0c 有一个这样的WebPart系统可以满足需求。这个WebPart的作者介绍:http://fredrik.nsquared2.com/viewpost.aspx?PostID=326

 4、启用WebPart得导出功能:修改web.config中WebPart的设置
  <webParts enableExport="true">

5、导入自定义的webPart 出现错误:Cannot add a control of Type DotnetClubPortal.WebControls.WebParts.RSSReader. The Type must be loadable by BuildManager.GetType(string typeName).
处理办法:修改web.config文件:
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="Bin" />
    </assemblyBinding>
 </runtime>
http://msdn2.microsoft.com/en-us/library/e0s9t4ck(en-US,VS.80).aspx

作者: 自由、创新、研究、探索……
出处:http://shanyou.cnblogs.com/
版权:本文版权归作者和博客园共有
转载:欢迎转载,为了保存作者的创作热情,请按要求【转载】,谢谢
要求:未经作者同意,必须保留此段声明;必须在文章中给出原文连接;否则必究法律责任
个人网站: http://www.openbeta.cn
posted @ 2005-12-03 21:20 geff zhang 阅读(9279) 评论(11)  编辑 收藏 网摘 所属分类: .net framework

  回复  引用  查看    
#1楼2005-12-04 21:54 | 而东      
1、启用匿名验证即可。
<anonymousIdentification enabled="true"/>
3、NSQUARED² 的blog的确不错,对于Webpart的文章很多。

  回复  引用    
#2楼2005-12-05 14:58 | QPG-Scott8088[未注册用户]
"自由、创新、研究、探索…… ",你好,请你先将你的Msn和电话联系方式发到qpg2006@126.com中,我会更新我们团队的通讯录,然后发给各位成员. (怕你不能及时看到,也在这留一下)
QPG-Scott8088(2005.12.05早)

  回复  引用    
#3楼2005-12-06 10:43 | wu ming[未注册用户]
看到你的文章了,我们团队中比较缺乏B/S的实践,希望今后你能发挥更大作用

alex

  回复  引用  查看    
#4楼[楼主]2006-01-14 21:33 | 自由、创新、研究、探索……      
I have added som new features to the WebPart Component. You can now with the <# WebPartDragSurfaceId #> marker specify which element that should be the one that you can use to drag a WebPart to another zone. The marker must be the value of an Id attribute on an element:
<td id=”<# WebPartDragSurfaceId #>”>
The reason why you need to add a id attribute is that the ASP.Net’s drag & drop feature uses the id too know which element that should be the one a user can use to drag the WebPart. I could have rendered the id attribute and the id’s value, but I don’t know if the element you want to have as the drag surface already have an id attribute or not. So I decided that you need to add the id attribute.
Another marker that is added is the <# WebPartIndex #> marker. This marker will render a unique number for each WebParat. This maker can be used together with client side script, for example maybe you want to add a way to hide the WebPart content with client side script:

<td id="WebPart1_<# WebPartIndex #>">
<a href="#" onclick='document.getElementById("WebPart1_<# WebPartIndex #>").style.display="none"'>Hide dynamic</a><br />

<# WebPartBody #>

</td>

The maker will make sure you have an id that is unique for the WebParts.
You can download the WebPart Component from the WebPart Component workspace.

  回复  引用    
#5楼2006-04-04 21:58 | newbie[未注册用户]
有没有人用过AppearanceEditorPart?
我不知道怎么样把AppearanceEditorPart中的Title等改为中文,而且我只想显示标题属性,而不想显示其它Chrome Type等等,应该怎么做?
望高手解答。

  回复  引用  查看    
#6楼2006-08-15 14:04 | aspnetx      
学习中
  回复  引用  查看    
#7楼[楼主]2006-08-20 20:30 | 自由、创新、研究、探索……      
EditorPart over a User Control webpart and moving EditorPart along with a webpart
http://www.codeproject.com/aspnet/UserControlWebparts.asp">http://www.codeproject.com/aspnet/UserControlWebparts.asp

  回复  引用  查看    
#8楼[楼主]2006-08-20 21:10 | 自由、创新、研究、探索……      
Achieve multiple tasks (child window) functionality in a web application using UIAPB
http://www.codeproject.com/useritems/MultipleTasksInUIPAB.asp">http://www.codeproject.com/useritems/MultipleTasksInUIPAB.asp

  回复  引用    
#11楼2007-07-24 15:47 | 一抹微蓝
感觉这玩意不好控制



发表评论

昵称: [登录] [注册]

主页:

邮箱:(仅博主可见)

评论内容:

  登录  注册

[使用Ctrl+Enter键快速提交评论]

0 290125




相关文章:

相关链接: