DataList Using asp.net c# and Design css style:
CSS Style:
.CssOuting
{
border: 2px solid #84945a;
-moz-border-radius: 8px;
background-image: url(../Images/Home/bg_pattern.jpg);
-webkit-border-radius: 8px;
-khtml-border-radius: 8px;
color: #071019;
box-shadow: inset 0 0 45px #84945a;
padding: 0px;
margin-left: 10px;
margin-top: 20px;
width: 830px;
}
.Head
{
font-size: 25px;
font-family: Georgia, Times New Roman, serif;
color:#84945a;
height: 50px;
line-height:2;
border-bottom:dotted 1px #84945a;
}
.HeadType
{
color: #826279;
margin-left: 20px;
font-family:Verdana;
font-size:18px;
font-weight:bold;
}
.tbltd
{
margin: 10px;width: 170px;
}
.divtd
{
webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background-color: White; /*border: solid 2px #755095;*/
border: solid 2px silver;
margin: 10px;
height: 200px;
}
.divtda
{
font-weight: bold;
font-family: Georgia, Times New Roman, serif;
color: Maroon;
margin: 10px;
}
.divtdImg
{
width: 125px;height: 140px;
margin: 10px;
}
.divSpanHd
{
webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px; /*border: solid 2px #755095;*/
border: solid 2px silver;
background-color: #4da28f;
font-family: Verdana;
height: 35px;
font-weight: bold;
color: White;
font-size: 20px;
text-align: center;
}
-----------------------------------------------------------------
aspx :
<div class="CssOuting">
<div align="center" class="Head">
Actor
</div>
<div class="HeadType">
Actor Type
</div>
<div>
<asp:DataList Width="750px" ID="dlActor" RepeatColumns="3"
RepeatLayout="Table" runat="server">
<ItemTemplate>
<table>
<tr>
<td class="tbltd">
<div class="divtd">
<a href="Actor.aspx?Name=<%#Eval("ActorName")%>"
class="divtda"
<img src='<%#Eval("ActImgPath")%>'
Class="divtdImg" />
<br />
</a>
<div class="divSpanHd">
<asp:Label ID="lblName" runat="server"
Text='<%# Eval("subcategoryname")%>'>
</asp:Label>
</div>
</div>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</div>
-----------------------------------------------------------------
aspx:cs C#
SqlConnection Conn = new SqlConnection(ConfigurationManager.AppSettings["Connections"]);
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
string Select ;
protected void Page_Load(object sender, EventArgs e)
{
View();
}
public void View()
{
Select = "Select * From Actor";
da = new SqlDataAdapter(Select, Conn);
da.Fill(ds);
if (ds.Tables[0].Rows.Count != 0)
{
dlActor.DataSource = dsPho;
dlActor.DataBind();
}
else
{
Response.write("No Data");
}
}
-----------------------------------------------------------------
Screen:
No comments:
Post a Comment