制作Google-Like的WebPart
作者:admin 出处:博客园 时间:08年09月18日
class="posthead"
h2 /h2
/div
class="postbody"
1.图标文件(原版和RollOver效果)
color="#0000cc" face="Verdana"a href="http://files.cnblogs.com/JOSHUATSUEI/GoogleLikeWebPartButtons.rar"http://files.cnblogs.com/JOSHUATSUEI/GoogleLikeWebPartButtons.rar/a/font
效果图
img border="0" alt="" src="http://images.cnblogs.com/cnblogs_com/joshuatsuei/GoogleLikeWebPartButton.gif" width="485" height="257" /
2.WebPart的ASPX代码
class="cnblogs_code"img style="DISPLAY: none" id="Code_Closed_Image_102357" onclick="this.style.display='none'; document.getElementById('Code_Closed_Text_102357').style.display='none'; document.getElementById('Code_Open_Image_102357').style.display='inline'; document.getElementById('Code_Open_Text_102357').style.display='inline';" align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" width="11" height="16" alt="" /img style="DISPLAY: inline" id="Code_Open_Image_102357" onclick="this.style.display='none'; document.getElementById('Code_Open_Text_102357').style.display='none'; getElementById('Code_Closed_Image_102357').style.display='inline'; getElementById('Code_Closed_Text_102357').style.display='inline';" align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" width="11" height="16" alt="" / style="DISPLAY: none" id="Code_Closed_Text_102357" class="cnblogs_code_Collapse"Google-Like WebPart/span style="DISPLAY: inline" id="Code_Open_Text_102357"
!--br /
br /
Code highlighting produced by Actipro CodeHighlighter (freeware)br /
http://www.CodeHighlighter.com/br /
br /
-- style="COLOR: #000000" /span style="COLOR: #0000ff"/span style="COLOR: #800000"asp:WebPartZone /span style="COLOR: #ff0000"ID/span style="COLOR: #0000ff"="WebPartZone1"/span style="COLOR: #ff0000" runat/span style="COLOR: #0000ff"="server"/span style="COLOR: #ff0000" Height/span style="COLOR: #0000ff"="175px"/span style="COLOR: #ff0000" WebPartVerbRenderMode/span style="COLOR: #0000ff"="TitleBar"/span style="COLOR: #ff0000"
Width/span style="COLOR: #0000ff"="364px"/span style="COLOR: #0000ff"/span style="COLOR: #000000"
/span style="COLOR: #0000ff"/span style="COLOR: #800000"TitleBarVerbStyle /span style="COLOR: #ff0000"Width/span style="COLOR: #0000ff"="15px"/span style="COLOR: #ff0000" /span style="COLOR: #0000ff"//span style="COLOR: #000000"
/span style="COLOR: #0000ff"/span style="COLOR: #800000"RestoreVerb /span style="COLOR: #ff0000"ImageUrl/span style="COLOR: #0000ff"="~/images/WebPart_Max.gif"/span style="COLOR: #ff0000" /span style="COLOR: #0000ff"//span style="COLOR: #000000"
/span style="COLOR: #0000ff"/span style="COLOR: #800000"CloseVerb /span style="COLOR: #ff0000"ImageUrl/span style="COLOR: #0000ff"="~/images/WebPart_Close.gif"/span style="COLOR: #ff0000" /span style="COLOR: #0000ff"//span style="COLOR: #000000"
/span style="COLOR: #0000ff"/span style="COLOR: #800000"MinimizeVerb /span style="COLOR: #ff0000"ImageUrl/span style="COLOR: #0000ff"="~/images/WebPart_Mini.gif"/span style="COLOR: #ff0000" /span style="COLOR: #0000ff"//span style="COLOR: #000000"
/span style="COLOR: #0000ff"/span style="COLOR: #800000"PartTitleStyle /span style="COLOR: #ff0000"BackColor/span style="COLOR: #0000ff"="#E4F1FD"/span style="COLOR: #ff0000" /span style="COLOR: #0000ff"//span style="COLOR: #000000"
/span style="COLOR: #0000ff"/span style="COLOR: #800000"ConnectVerb /span style="COLOR: #ff0000"Visible/span style="COLOR: #0000ff"="False"/span style="COLOR: #ff0000" /span style="COLOR: #0000ff"//span style="COLOR: #000000"
/span style="COLOR: #0000ff"/span style="COLOR: #800000"EditVerb /span style="COLOR: #ff0000"Visible/span style="COLOR: #0000ff"="False"/span style="COLOR: #ff0000" /span style="COLOR: #0000ff"//span style="COLOR: #000000"
/span style="COLOR: #0000ff"/span style="COLOR: #800000"ZoneTemplate/span style="COLOR: #0000ff"/span style="COLOR: #000000"
/span style="COLOR: #0000ff"/span style="COLOR: #800000"asp:Button /span style="COLOR: #ff0000"ID/span style="COLOR: #0000ff"="Button1"/span style="COLOR: #ff0000" runat/span style="COLOR: #0000ff"="server"/span style="COLOR: #ff0000" Text/span style="COLOR: #0000ff"="Button"/span style="COLOR: #ff0000" /span style="COLOR: #0000ff"//span style="COLOR: #000000"
/span style="COLOR: #0000ff"//span style="COLOR: #800000"ZoneTemplate/span style="COLOR: #0000ff"/span style="COLOR: #000000"
/span style="COLOR: #0000ff"//span style="COLOR: #800000"asp:WebPartZone/span style="COLOR: #0000ff"/span/span/div
效果图
img border="0" alt="" src="http://images.cnblogs.com/cnblogs_com/joshuatsuei/GoogleLikeWebPart.gif" width="372" height="81" /
3.问题
WebPart标题上的按钮只支持ImageURL,却没有CSS属性,而且形成的HTML元素(IMG)没有ID。本来是想做RollOver的效果(图标已经在压缩包中),但是实现不了,各位如果有好的方法请指教。实在不行我就得加脚本或者重载WebPart类了。
/div
