Results 1 to 4 of 4
  1. #1
    McInerny is offline Member
    Join Date
    Apr 2008
    Posts
    1
    Rep Power
    0

    Default Reference Datalist Selected Value using JavaScript, Java (no postback)

    Quick question, I hope.

    I am trying to reference the Selected Value of a DataList from JavaScript. I have tried loads of different ways, I just can't get it.

    The Datalist is in a page which has a master page, the code is below.

    Can someone give me the code, if possible to retrieve the Selected Value.

    Thanks

    <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server" >

    <asp:UpdatePanel ID="UpdatePanel4" runat="server" >
    <ContentTemplate>

    <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" RepeatColumns="7" RepeatDirection="Horizontal" ShowFooter="False" ShowHeader="False" CssClass="DatalistLinkButton" DataKeyField="STID" >
    <ItemTemplate>

    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Select"
    CommandArgument='<%# Eval("STID") %>' CssClass="DatalistLinkButton"
    Text='<%# Eval("STName") %>' />

    </ItemTemplate>
    </asp:DataList>
    </ContentTemplate>
    </asp:UpdatePanel>
    </asp:Content>

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    9

    Default

    If I knew how to read Javascript I would help.... are you trying to retrieve the value using Java? or Javascript? If the latter only, you've chosen the wrong forum.. if the former maybe someone can merge the two technologies together to help you.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  3. #3
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    can we delete this whole topic? seems to be attracting spam...

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. JTable Gridline in selected row
    By arubin in forum AWT / Swing
    Replies: 11
    Last Post: 11-24-2009, 08:05 PM
  2. Object and reference
    By katie in forum New To Java
    Replies: 2
    Last Post: 10-19-2009, 04:45 PM
  3. Replies: 0
    Last Post: 04-07-2008, 08:44 AM
  4. Getting the Object Reference Name
    By Deathmonger in forum New To Java
    Replies: 2
    Last Post: 03-12-2008, 03:51 PM
  5. JavaScript to Java Statement
    By mutuah in forum Advanced Java
    Replies: 0
    Last Post: 08-08-2007, 06:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •