Click here to Skip to main content
15,885,216 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: A few points to consider while working with literal string in ASP.NET Pin
Richard MacCutchan28-Feb-15 6:47
mveRichard MacCutchan28-Feb-15 6:47 
GeneralRe: A few points to consider while working with literal string in ASP.NET Pin
Afzaal Ahmad Zeeshan28-Feb-15 6:53
professionalAfzaal Ahmad Zeeshan28-Feb-15 6:53 
GeneralRe: A few points to consider while working with literal string in ASP.NET Pin
Richard MacCutchan28-Feb-15 21:26
mveRichard MacCutchan28-Feb-15 21:26 
GeneralRe: A few points to consider while working with literal string in ASP.NET Pin
F-ES Sitecore2-Mar-15 0:12
professionalF-ES Sitecore2-Mar-15 0:12 
GeneralRe: A few points to consider while working with literal string in ASP.NET Pin
Afzaal Ahmad Zeeshan2-Mar-15 3:03
professionalAfzaal Ahmad Zeeshan2-Mar-15 3:03 
Questionopen project mvc Pin
Nguyen Jay27-Feb-15 16:55
Nguyen Jay27-Feb-15 16:55 
AnswerRe: open project mvc Pin
Afzaal Ahmad Zeeshan28-Feb-15 3:24
professionalAfzaal Ahmad Zeeshan28-Feb-15 3:24 
Questionneed help to add paging in datalist access db with vb code Pin
Member 1148584027-Feb-15 8:46
Member 1148584027-Feb-15 8:46 
XML
I am looking for some help, I want to add paging in datalist on my client's website, the code is as follows: If you required any other information or need files to review the html and code file please mention

aspx page
<asp:DataList ID="DataList1" runat="server" RepeatColumns="4" RepeatDirection="Horizontal">
        <ItemTemplate>
            <asp:ImageButton ID="img_product" runat="server" ImageUrl='<%# Eval("it_pic1_s") %>' Height="214px" Width="196px" BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" /><br />
            <asp:Label ID="lbl_code" runat="server" Text='<%# Eval("it_code") %>' Font-Bold="True"></asp:Label><br />
            <asp:Label ID="lbl_name" runat="server" Text='<%# Eval("it_name") %>'></asp:Label><br />
            Old Price USD
            <asp:Label ID="lbl_old_price" runat="server" Text='<%# Eval("old_price") %>'></asp:Label>/pc
            <br />
            <strong>New Price USD</strong>
            <asp:Label ID="lbl_new_price" runat="server" Text='<%# Eval("new_price") %>' ForeColor="Maroon"></asp:Label>/pc
            <br />
            <asp:ImageButton ID="img_button" runat="server" ImageUrl="~/images/leather-shop_52.jpg" />
        </ItemTemplate>
        <SeparatorStyle BackColor="White" BorderColor="White" />
    </asp:DataList>&nbsp;</div>


Code file:

VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not Page.IsPostBack Then

            Dim cn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("~\App_Data\order_database.mdb"))


            Dim varProduct As String
            varProduct = "leather jacket"
Dim varQty = 0
Dim query1 = "select it_code, it_name, it_qty, it_pic1_s, old_price, new_price from item_stock where it_keywords LIKE '%" & varProduct & "%' AND it_qty = '" & 1 & "'"
Dim da1 As New OleDbDataAdapter(query1, cn1)
            Dim ds1 As New DataSet
            da1.Fill(ds1, "item_Stock")



            If ds1.Tables(0).Rows().Count() >= 1 Then

                Me.DataList1.DataSource = ds1
                Me.DataList1.DataBind()
Dim lbl_old_price As Label = CType(FindControl("lbl_old_price"), Label)
                Dim lbl_new_price As Label = CType(FindControl("lbl_new_price"), Label)
                Dim lbl_code As Label = CType(FindControl("lbl_code"), Label)
                Dim lbl_name As Label = CType(FindControl("lbl_name"), Label)
                Dim img_product As ImageButton = CType(FindControl("img_product"), ImageButton)


            End If

            ' ''Counting of cart items
            Dim cbrowser = (Request.ServerVariables("http_user_agent"))
            Dim clientip = (Request.ServerVariables("remote_addr"))
            Dim cdnsip = (Request.ServerVariables("remote_host"))
            Dim varCartStatus = "1"
            Dim cmda5 As OleDbCommand = New OleDbCommand("Select Count(id) from shopping_cart where client_browser = '" & cbrowser & "' AND client_ip = '" & clientip & "' AND cart_status = '" & varCartStatus & "'", New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("~\App_Data\order_database.mdb")))
            cmda5.Connection.Open()
            Dim count As Integer
            count = cmda5.ExecuteScalar()
            If count > 1 Then

                Me.lbl_count.Text = "Items[" & count & "]"
            Else
                Me.lbl_count.Text = "Item[" & count & "]"
            End If
cmda5.Connection.Close()

        End If

    End Sub

SuggestionRe: need help to add paging in datalist access db with vb code Pin
Richard Deeming27-Feb-15 10:31
mveRichard Deeming27-Feb-15 10:31 
Questionvb function / sub call using javascript . Pin
Member 815140727-Feb-15 8:13
Member 815140727-Feb-15 8:13 
AnswerRe: vb function / sub call using javascript . Pin
ZurdoDev27-Feb-15 9:35
professionalZurdoDev27-Feb-15 9:35 
Question"End of statement Expected" error Pin
samflex27-Feb-15 5:11
samflex27-Feb-15 5:11 
AnswerRe: "End of statement Expected" error Pin
PIEBALDconsult27-Feb-15 5:25
mvePIEBALDconsult27-Feb-15 5:25 
AnswerRe: "End of statement Expected" error Pin
Richard Deeming27-Feb-15 6:28
mveRichard Deeming27-Feb-15 6:28 
GeneralRe: "End of statement Expected" error Pin
samflex27-Feb-15 6:40
samflex27-Feb-15 6:40 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming27-Feb-15 8:04
mveRichard Deeming27-Feb-15 8:04 
GeneralRe: "End of statement Expected" error Pin
samflex27-Feb-15 9:03
samflex27-Feb-15 9:03 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming27-Feb-15 10:29
mveRichard Deeming27-Feb-15 10:29 
GeneralRe: "End of statement Expected" error Pin
samflex27-Feb-15 10:44
samflex27-Feb-15 10:44 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming2-Mar-15 1:43
mveRichard Deeming2-Mar-15 1:43 
GeneralRe: "End of statement Expected" error Pin
samflex2-Mar-15 4:04
samflex2-Mar-15 4:04 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming2-Mar-15 7:10
mveRichard Deeming2-Mar-15 7:10 
GeneralRe: "End of statement Expected" error Pin
samflex2-Mar-15 14:55
samflex2-Mar-15 14:55 
QuestionJSON Hijacking and ASP.Net MVC Pin
Tridip Bhattacharjee27-Feb-15 1:55
professionalTridip Bhattacharjee27-Feb-15 1:55 
AnswerRe: JSON Hijacking and ASP.Net MVC Pin
Richard MacCutchan27-Feb-15 3:00
mveRichard MacCutchan27-Feb-15 3:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.