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

RSS Feed in asp.net

Friday, September 23, 2011

Jquery Menu

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
body { font: 14px Helvetica, Sans-Serif; }
ul { list-style: none; }
a { text-decoration: none; }
#page-wrap { width: 800px; margin: 25px auto; }
p { margin: 15px 0; }
* { margin: 0; padding: 0; }
ul.dropdown { position: relative; }
ul.dropdown li { font-weight: bold; float: left; zoom: 1; background: #ccc; }
ul.dropdown a:hover { color: #000; }
ul.dropdown a:active { color: #ffa500; }
ul.dropdown li a { display: block; padding: 4px 8px; border-right: 1px solid #333; color: #222; }
ul.dropdown li:last-child a { border-right: none; }
ul.dropdown li:hover,ul.dropdown li:hover { background: #F3D673; color: black; position: relative; }
ul.dropdown li.hover a { color: black; }
ul.dropdown ul { width: 220px; visibility: hidden; position: absolute; top: 100%; left: 0; }
ul.dropdown ul li { font-weight: normal; background: #f6f6f6; color: #000;
border-bottom: 1px solid #ccc; float: none; }
ul.dropdown ul li a { border-right: none; width: 100%; display: inline-block; }
ul.dropdown ul ul { left: 100%; top: 0; }
ul.dropdown li:hover > ul { visibility: visible; }
</style>
<script type="text/javascript" src="JavaScript/jquery-1.3.1.min.js"></script>
<script type="text/javascript">
$(function () {

$("ul.dropdown li").hover(function () {

$(this).addClass("hover");
$('ul:first', this).css('visibility', 'visible');
}, function () {

$(this).removeClass("hover");
$('ul:first', this).css('visibility', 'hidden');

});

$("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");

});

</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="page-wrap">
<ul class="dropdown">
<li><a href="#">First item</a>
<%--///Forst level--%>
<ul>
<li><a href="#">Level11</a></li>
<li><a href="#">Level12</a>
<ul>
<li><a href="#">level21</a></li>
<li><a href="#">level22</a></li>
<li><a href="#">Level23</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Second Menu</a>
<ul>
<li><a href="#">Submenu21</a>
<ul>
<li><a href="#">2nlebel Submenu</a></li>
</ul>
</li>
<li><a href="#">Submenu22</a></li>

</ul>
</li>
</ul>
</div>
</div>
</form>
</body>
</html>