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. help ListView and SelectedValue onloadpage

help ListView and SelectedValue onloadpage

Scheduled Pinned Locked Moved ASP.NET
sysadminhelpquestionworkspace
1 Posts 1 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.
  • O Offline
    O Offline
    orsini
    wrote on last edited by
    #1

    Hi, I setup my listview Selected value to 0, when my page is loaded, i can't get that value to filter a sqldatasource. i try to read it and populate a label and it doesnt work, here is the code. any idea? Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Label1.Text = ListView1.SelectedValue End Sub <asp:ListView ID="ListView1" runat="server" DataKeyNames="pid" DataSourceID="SqlDataSource1" GroupItemCount="3" SelectedIndex="0"> <AlternatingItemTemplate> <td runat="server" style=""> pid: <asp:Label ID="pidLabel" runat="server" Text='<%# Eval("pid") %>' /> <br /> p_tn: <asp:Label ID="p_tnLabel" runat="server" Text='<%# Eval("p_tn") %>' /> <br /> </td> </AlternatingItemTemplate> <LayoutTemplate> <table runat="server"> <tr runat="server"> <td runat="server"> <table ID="groupPlaceholderContainer" runat="server" border="0" style=""> <tr ID="groupPlaceholder" runat="server"> </tr> </table> </td> </tr> <tr runat="server"> <td runat="server" style=""> </td> </tr> </table> </LayoutTemplate> <EmptyItemTemplate> <td runat="server" /> </EmptyItemTemplate> <InsertItemTemplate> <td runat="server" style=""> p_tn: <asp:TextBox ID="p_tnTextBox" runat="server" Text='<%# Bind("p_tn") %>' /> <br /> <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" /> <br /> <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />

    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