Spiga

Asp.net 2.0 WebPart使用经验点滴

2005-12-03 21:20 by geff zhang, 9760 visits, 网摘, 收藏, 编辑


这几天学习使用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/
0
0
(请您对文章做出评价)
« 上一篇:MS 的IOC容器(ObjectBuilder)?
» 下一篇:使用xfce4桌面系统
Add your comment

11 条回复

  1. #1楼 而东      2005-12-04 21:54
    1、启用匿名验证即可。
    <anonymousIdentification enabled="true"/>
    3、NSQUARED² 的blog的确不错,对于Webpart的文章很多。
      回复  引用  查看    
  2. #2楼 QPG-Scott8088[未注册用户]2005-12-05 14:58
    "自由、创新、研究、探索…… ",你好,请你先将你的Msn和电话联系方式发到qpg2006@126.com中,我会更新我们团队的通讯录,然后发给各位成员. (怕你不能及时看到,也在这留一下)
    QPG-Scott8088(2005.12.05早)
      回复  引用    
  3. #3楼 wu ming[未注册用户]2005-12-06 10:43
    看到你的文章了,我们团队中比较缺乏B/S的实践,希望今后你能发挥更大作用

    alex
      回复  引用    
  4. #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. #5楼 newbie[未注册用户]2006-04-04 21:58
    有没有人用过AppearanceEditorPart?
    我不知道怎么样把AppearanceEditorPart中的Title等改为中文,而且我只想显示标题属性,而不想显示其它Chrome Type等等,应该怎么做?
    望高手解答。
      回复  引用    
  6. #6楼 aspnetx      2006-08-15 14:04
    学习中
      回复  引用  查看    
  7. #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
      回复  引用  查看    
  8. #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
      回复  引用  查看    
  9. #9楼[楼主] 自由、创新、研究、探索……      2006-11-01 20:46
    Sharing Web Parts across multiple pages
    http://www.simple-talk.com/dotnet/asp.net/web-parts-in-asp.net-2.0/
      回复  引用  查看    
  10. #10楼[楼主] 自由、创新、研究、探索……      2006-12-18 22:52
    Web Parts - How to create a tabbed view
    http://markitup.com/Posts/Post.aspx?postId=ff844ac4-9ce5-48e8-a762-844931e7c436
      回复  引用  查看    
  11. #11楼 一抹微蓝2007-07-24 15:47
    感觉这玩意不好控制
      回复  引用