Question : image in datalist

i use image in datalist
when product sell best
this image is visible
but when it not visible
it look like see my image below

 

Answer : image in datalist

wats d condition u need to check????
itemdatabound can do ur task...

Here one working example which does according to the database values .

Similarly u can do by changing to ur needs,,

M
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ddldesigncontrol.aspx.vb" Inherits="ddldesigncontrol" %> 
 


    Datalist Design Page On Dynamic


    
    
    

  
Imports System.Data
Imports System.Data.SqlClient 
Partial Class ddldesigncontrol
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack = False Then
            bindlist()
        End If
    End Sub
    Sub bindlist()
        Dim constr = ConfigurationManager.AppSettings("con").ToString()
        Dim con As SqlConnection = New SqlConnection(constr)
        con.Open()
        Dim sql1 = "Select * from tbl1"  ' change to ur table name
        Dim sql As SqlCommand = New SqlCommand(sql1, con)
        Dim ds As DataSet = New DataSet()
        Dim da As SqlDataAdapter = New SqlDataAdapter(sql)
        da.Fill(ds)
        If ds.Tables(0).Rows.Count > 0 Then
            DataList1.DataSource = ds
            DataList1.DataBind()
        End If
        con.Close()
    End Sub 
    Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound
        Dim hdn_price As HiddenField = TryCast(e.Item.FindControl("price"), HiddenField)
        Dim a_link As HtmlAnchor = TryCast(e.Item.FindControl("anchortag"), HtmlAnchor)
        If hdn_price.Value = "ListPrice " Then
            a_link.Style.Add("font-size", "10px")
        Else
            a_link.Style.Add("font-size", "30px")
        End If
    End Sub
End Class
Random Solutions  
 
programming4us programming4us