Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How I can convert my '<%# Eval.......%>' code in Page.aspx to Page.aspx.vb ?

How I can convert my '<%# Eval.......%>' code in Page.aspx to Page.aspx.vb ?

Scheduled Pinned Locked Moved ASP.NET
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Saba02
    wrote on last edited by
    #1

    Hi all, I have code for menu in page.aspx, but now i want write this code in page.aspx.vb for menu programming. How i can convert this code? this is my code:

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
    <Columns>
    asp:TemplateField
    <ItemTemplate>
    <asp:Panel ID="Panel1" Runat="Server">
    <asp:LinkButton ID="LinkButton1" Text='<%# Eval("nam") %>' Runat="Server"
    PostBackUrl='<%# Eval("id","Page.aspx?id={0}") %>'

            ForeColor="#990000"
            Font-Underline="False"/>
      </asp:Panel>
    </ItemTemplate>
    

    </asp:TemplateField>
    </Columns>
    </asp:GridView>

    i didn't use SqlDataSouece, and i used dataset for filling gridview. Now how i can write these code in page.aspx.vb instead of using Eval in page.aspx? Thank you

    Hoda

    N 1 Reply Last reply
    0
    • S Saba02

      Hi all, I have code for menu in page.aspx, but now i want write this code in page.aspx.vb for menu programming. How i can convert this code? this is my code:

      <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
      <Columns>
      asp:TemplateField
      <ItemTemplate>
      <asp:Panel ID="Panel1" Runat="Server">
      <asp:LinkButton ID="LinkButton1" Text='<%# Eval("nam") %>' Runat="Server"
      PostBackUrl='<%# Eval("id","Page.aspx?id={0}") %>'

              ForeColor="#990000"
              Font-Underline="False"/>
        </asp:Panel>
      </ItemTemplate>
      

      </asp:TemplateField>
      </Columns>
      </asp:GridView>

      i didn't use SqlDataSouece, and i used dataset for filling gridview. Now how i can write these code in page.aspx.vb instead of using Eval in page.aspx? Thank you

      Hoda

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Handle RowDataBound[^] event, use FindControl() to find the link button and set the PostBackUrl. Looks like you need a HyperLink button here, not LinkButton. :)

      Navaneeth How to use google | Ask smart questions

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups