Click here to Skip to main content
15,890,670 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Helloww.... everyone,, i want to ask something.
i've tried to get value from listview using javascript, but it doesn't work.

this sample code below:
ASP.NET
<script language="javascript" type="text/javascript">
    function Show(val) {
        alert(val);
        return false;
    }
</script>
<asp:ListView ID="listPasien" runat="server" >
<LayoutTemplate>
    <div id="itemPlaceHolder" runat="server"></div>
</LayoutTemplate>
<ItemTemplate>
    <div>
      <asp:LinkButton onclientclick='Show(<%# Eval("AutoID") %>)' ID="lnkInfo" runat="server">View</asp:LinkButton>
    </div>
</ItemTemplate>
</asp:ListView>


how i get and show value AutoID?
can you help me in code?
Posted
Updated 7-Aug-11 22:44pm
v4

Try this in LinkButton OnClientClick event.
OnClientClick='<%# Eval("AutoID", "Show({0})")%>'
 
Share this answer
 
Thanks jakson,,your sample very helpfull..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900