I have this on my aspx page
<asp:Repeater id="Repeater2" runat="server">
<HeaderTemplate>
<table><tr>
</HeaderTemplate>
<ItemTemplate>
<td align="middle">
<a href='javascript:checkurl(<%# DataBinder.Eval(Container.DataItem,"Prod_id")%>,<%# DataBinder.Eval(Container.DataItem,"model_id")%>)'>
<img src='images/<%# DataBinder.Eval(Container.DataItem,"fullimg")%>' border=0 style="BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid" id='<%# DataBinder.Eval(Container.DataItem,"fullimg")%>'></a>
<br>
</td>
</ItemTemplate>
<FooterTemplate>
</tr> </table>
</FooterTemplate>
</asp:Repeater>
and also this one in behind code
private void Page_Load(object sender, System.EventArgs e)
{
String Qid=Request.QueryString["id"];
Qid="5";
String SelCmd="Select * from TblFRModel Where prod_id=@id";
SqlConnection myConnection=new SqlConnection(ConnectionInfo);
SqlCommand myCommand=new SqlCommand(SelCmd,myConnection);
myCommand.Parameters.Add(new SqlParameter("@id",SqlDbType.Int));
myCommand.Parameters["@id"].Value=System.Convert.ToInt32(Qid);
myCommand.Connection.Open();
SqlDataReader dr=myCommand.ExecuteReader();
Repeater2.DataSource=dr;
Repeater2.DataBind();
dr.Close();
myCommand.Connection.Close();
}
and this Itemdatabind
private void Repeater2_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) {
if( (e.Item.ItemType == ListItemType.Item))
{
DbDataRecord dbr = (DbDataRecord)e.Item.DataItem;
if( Convert.ToString(DataBinder.Eval(dbr, "fullimg")) == "USA" )
/***********/
heer i should access to style border of image to make a border for it, which i don't know what is the syntax
/***********/
}
}
and the second qesution it doesn't enter the ItemDataBound Method
This is the InitializeComponent Method
private void InitializeComponent()
{
this.Repeater2.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.Repeater2_ItemDataBound);
this.Load += new System.EventHandler(this.Page_Load);
}
but it doesn't enter the Item data bound?