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. Eval(sesion[key])

Eval(sesion[key])

Scheduled Pinned Locked Moved ASP.NET
5 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.
  • T Offline
    T Offline
    TALHAKOSEN
    wrote on last edited by
    #1

    Hi all, I have a datalist and i want to fill datalist from 2 sqldatasource retuning 2 different table. In a button1_click event, i wrote dt1.datasource = sd1; return fields picID,picName ... dt1.databind(); In a button2_click event, i wrote dt1.datasource = sd2; return fields userID,userName.... dt1.databind(); i wrote on aspx file for a label text <%# eval("picID") %> for example <%# session[mysessionkey] %> but i wanna change this dynamically, Thanks ...

    thanks for everything i have...

    A 1 Reply Last reply
    0
    • T TALHAKOSEN

      Hi all, I have a datalist and i want to fill datalist from 2 sqldatasource retuning 2 different table. In a button1_click event, i wrote dt1.datasource = sd1; return fields picID,picName ... dt1.databind(); In a button2_click event, i wrote dt1.datasource = sd2; return fields userID,userName.... dt1.databind(); i wrote on aspx file for a label text <%# eval("picID") %> for example <%# session[mysessionkey] %> but i wanna change this dynamically, Thanks ...

      thanks for everything i have...

      A Offline
      A Offline
      anilpal
      wrote on last edited by
      #2

      Hi, Now there can 2 solution or may even more. 1. Take one public variable and assign column name on button click based on requirement like ID="picID" // button1 ID="UserID"// button2 or else 2. You can rename the column name of the either dataTable on run time like: ds.Tables[0].Columns[0].ColumnName = "Abc"; feel free to ask

      Regards Anil Pal

      T 1 Reply Last reply
      0
      • A anilpal

        Hi, Now there can 2 solution or may even more. 1. Take one public variable and assign column name on button click based on requirement like ID="picID" // button1 ID="UserID"// button2 or else 2. You can rename the column name of the either dataTable on run time like: ds.Tables[0].Columns[0].ColumnName = "Abc"; feel free to ask

        Regards Anil Pal

        T Offline
        T Offline
        TALHAKOSEN
        wrote on last edited by
        #3

        Thanks for your reply, .aspx file ItemTemplate Label ID="Label1" runat="server" text=<%#Eval(ID)%> ItemTemplate .cs file string ID; ------ how can i send this to item template, when i wrote like text=<%#Eval(ID)%> it gives error protected void Button1_Click(object sender, EventArgs e) { ID = "picID"; DataList1.DataSource = SqlDataSource1; DataList1.DataBind(); } protected void Button2_Click(object sender, EventArgs e) { ID = "UserID"; DataList1.DataSource = SqlDataSource2; DataList1.DataBind(); }

        thanks for everything i have...

        A T 2 Replies Last reply
        0
        • T TALHAKOSEN

          Thanks for your reply, .aspx file ItemTemplate Label ID="Label1" runat="server" text=<%#Eval(ID)%> ItemTemplate .cs file string ID; ------ how can i send this to item template, when i wrote like text=<%#Eval(ID)%> it gives error protected void Button1_Click(object sender, EventArgs e) { ID = "picID"; DataList1.DataSource = SqlDataSource1; DataList1.DataBind(); } protected void Button2_Click(object sender, EventArgs e) { ID = "UserID"; DataList1.DataSource = SqlDataSource2; DataList1.DataBind(); }

          thanks for everything i have...

          A Offline
          A Offline
          anilpal
          wrote on last edited by
          #4

          hi, OK try another

          Regards Anil Pal

          1 Reply Last reply
          0
          • T TALHAKOSEN

            Thanks for your reply, .aspx file ItemTemplate Label ID="Label1" runat="server" text=<%#Eval(ID)%> ItemTemplate .cs file string ID; ------ how can i send this to item template, when i wrote like text=<%#Eval(ID)%> it gives error protected void Button1_Click(object sender, EventArgs e) { ID = "picID"; DataList1.DataSource = SqlDataSource1; DataList1.DataBind(); } protected void Button2_Click(object sender, EventArgs e) { ID = "UserID"; DataList1.DataSource = SqlDataSource2; DataList1.DataBind(); }

            thanks for everything i have...

            T Offline
            T Offline
            TALHAKOSEN
            wrote on last edited by
            #5

            anyway thanks

            thanks for everything i have...

            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