Datagrid + buttons in VB

Discussion in 'Software' started by Ashraf123, Oct 26, 2010.

  1. Ashraf123

    Ashraf123

    Joined:
    Oct 24, 2010
    Messages:
    1
    Hi guys,
    I would like some help in programming code, its Datagrid and asp: button,
    I have a list of items and I would like the client to press a button (Add to Cart) and add to shopping cart I have the code and does work in view items page and does do, what I want, the problem I have is does not work in grid view or even datagrid it seem none of them can see asp: button in the VB code

    The code I am using in : (HTML) this working fine but the problem is VB net I keep getting the errors



    <ASP:DataGrid id="DGCrime" AutoGenerateColumns="False" Width="570px" CellPadding="0"
    runat="server" AllowPaging="True" PageSize="8"
    ShowHeader="False" GridLines="None">
    <PagerStyle CssClass="cssPager" NextPageText="<img src='masterImages/next.gif'/>" PrevPageText="<img src=masterImages/back.gif />" VerticalAlign="NotSet" HorizontalAlign="Center" Mode="NextPrev" ></PagerStyle>

    <Columns >
    <asp:TemplateColumn>
    <ItemTemplate>
    <table cellpadding="0" cellspacing="0" width="500px" align="left">
    <tr>
    <td align="left" rowspan="3" valign="top">
    <a href='./View_Details.aspx?ProdID= <%#Container.DataItem("ProdID")%>'>
    <img
    src='<%#Container.DataItem("imageFront")%>'
    alt='<%#Container.DataItem("Title")%>' id="image0" align="left" width="85px"></td>
    <td align="left" colspan="1" valign="top" width="600px">
    <asp:hyperlink id="myhlink2" runat="server"
    navigateurl='<%# "./View_Details.aspx?ProdID=" & DataBinder.Eval(Container,"DataItem.ProdID")%>'
    target="_self" text='<%#DataBinder.Eval(Container,"DataItem.Title")%>'
    Font-Bold="True" Font-Size="10.6pt"></asp:HyperLink>
    &nbsp;&nbsp;
    <b style="height: 15px; font-size: 11pt; font-weight: normal; font-style: normal; color: #000000;">
    <%# DataBinder.Eval(Container.DataItem, "Artist")%></b>
    <p style="color: #808000; font-size: 11.5pt; height: 20px; font-weight: bold;">
    <%# DataBinder.Eval(Container.DataItem, "Sprice", "{0:c}")%>&nbsp;&nbsp;<span style="font-size: 9pt; color: #FF00FF; font-weight: bold; font-family: Arial;">Free Delivery in UK Only</span></p>
    </td>
    </tr>
    <tr>
    <td align="left">
    <p style="width: 450px">
    <B>Quantity:</B>
    <br />
    <asp:TextBox id="txtQuantity" Columns="25" MaxLength="30" runat="server" Width="55px" style="text-align: center">1</asp:TextBox>

    <asp:Button ID="Bt2" runat="server" Text="BUY"/>
    </p>
    </td>
    <hr />
    </tr>
    </table>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>
    </asp:DataGrid>


    VB code


    Protected Sub bt2_click(ByVal sender As Object, ByVal e As EventArgs) Handles bt2_click


    End Sub


    Compiler Error Message: BC30287: '.' expected.

    Source Error:


    Line 69: End Sub
    Line 70:
    Line 71: Protected Sub bt2_click(ByVal sender As Object, ByVal e As EventArgs) Handles bt2_click
    Line 72:
    Line 73: Dim DBConn As SqlConnection

    Any will be thankful

    thanks
    Ashraf123, Oct 26, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kawabzi

    About Datagrid Columns

    Kawabzi, Sep 22, 2003, in forum: MCSD
    Replies:
    2
    Views:
    439
  2. Daniel Joskovski

    Re: Problems facing in datagrid pagecount

    Daniel Joskovski, Apr 7, 2004, in forum: MCSD
    Replies:
    0
    Views:
    454
    Daniel Joskovski
    Apr 7, 2004
  3. Daniel Joskovski

    Re: Problems facing in datagrid pagecount

    Daniel Joskovski, Apr 8, 2004, in forum: MCSD
    Replies:
    0
    Views:
    497
    Daniel Joskovski
    Apr 8, 2004
  4. adolf
    Replies:
    4
    Views:
    480
    The Poster Formerly Known as Kline Sphere
    Jun 7, 2004
  5. Ranjandada

    Multiple forms on datagrid

    Ranjandada, Jul 28, 2006, in forum: Software
    Replies:
    0
    Views:
    776
    Ranjandada
    Jul 28, 2006
Loading...

Share This Page