Friday, September 30, 2011

Webpart Themes

.css file Contains

{
width:1100px;
height:1002px;
}
.Zone
{
Width:250px;
border:3 solid black;
float:left;
}
.PartTitleStyle {
background-color:#C1D4E3;
height:25px;
font-size:8px;
padding:0px 0px 5px 10px;
background-image:url(../images/boxHeaderTopLeft.gif);
background-repeat: no-repeat; background-position: left top; }
.PartTitleStyle table {
background-image:url(../images/boxHeaderTopRight.gif);
background-repeat: no-repeat;
background-position: right top;}

.PartTitleStyle table tr td {
padding:10px 10px 0 10px;}
.PartTitleStyle table tr td span {
font-size:12px;
font-weight:bold;
background-color:#C1D4E3;
padding-right: -10px; }

.PartStyle {
background-color: #F8F8f0;
border: solid 1px #DDDDDD; }
.PartZone {
border:dashed 1px #DDDDDD; }
.PartZoneHeader {
height:0px;
display:none; }
==============================
Create a .Skin file
and Write the Code

<MSDLL:WebPartZone HeaderText=" " EmptyZoneText=" " runat="server"
HeaderStyle-CssClass="PartZoneHeader"
CssClass="Zone"
BorderStyle="None"
PartStyle-CssClass="PartStyle"
PartTitleStyle-CssClass="PartTitleStyle"
PartChromeStyle-BorderColor="White"
MenuPopupStyle-BackColor="#C1D4E3"
MenuPopupStyle-Font-Size="10px">
</MSDLL:WebPartZone>
===============================
in your .aspx
page Just add your control and Drag the .css into your .aspx design page
========================
<MSDLL:WebPartZone ID="MiddleZone" runat="server" class="Zone">

<ZoneTemplate>
</ZoneTemplate>
</MSDLL:WebPartZone>

Here I used MSDLL=MicroSoft dll file.... for browser compalibilty issue for Drag and Drop..
1) we use Microsoft.Web.Preview.dll file 
2) in Web.config file

<!--Adding Asembly-->
<system.web>


<pages controlRenderingCompatibilityVersion="4.0" theme="Controls" clientIDMode="AutoID">
<controls>
<add tagPrefix="MSDLL" namespace="Microsoft.Web.Preview.UI.Controls.WebParts" assembly="Microsoft.Web.Preview" />
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add tagPrefix="Ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
</controls>
</pages>
</system.web>


in the above html code tagPrefix="MSDLL" ,menas the webpartZone,Webpartmanger we are using is a Microsoft Webpartmanger,webpartZone....


in .aspx.cs file Use the name space as

using Microsoft.Web.Preview.UI.Controls.WebParts;

Reference from
-------------
http://live.mscommunity.net/blogs/borissevo/archive/2007/10/04/rounded-corners-for-web-parts-in-asp-net-2-0.aspx

No comments: