2
Answers

How to get the Listview value in through JavaScript

Anurag Srivastava

Anurag Srivastava

12y
4k
1

Hello All

        I want to get a OutPutIndicatorID value through JavaScript,
        OutPutIndicatorID is in ListView.
My code is:

<script language="javascript" type="text/javascript">

         function OpenFormula(OutPutIndicatorIDValue) {
             var controlid = OutPutIndicatorIDValue.toString();            
            alert(controlid);
        }
     </script>


<asp:ListView ID="lstEmissionReport" runat="server">
  <LayoutTemplate>
                                        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                                    </LayoutTemplate>
                                    <ItemTemplate>
                                        <tr>
                                                                                    
<asp:Label ID="OutPutIndicatorID" runat="server" Visible="false" Text='<%#(Eval("OutputIndicatorID").ToString()==""?"N/A" : Eval("OutputIndicatorID").ToString())%>'></asp:Label>
                                           
 <td class="detacell_one"  style="font-size:10px;">
 <asp:LinkButton ID="OutPutIndicatorName" runat="server" OnClientClick = 'javascript:OpenFormula("<%#(Eval("OutputIndicatorID").ToString())%>");'
Text='<%#(Eval("OutputIndicatorName").ToString()==""?"N/A" : Eval("OutputIndicatorName").ToString())%>'></asp:LinkButton>
    </td>


Answers (2)