I want to get a OutPutIndicatorID value through JavaScript,
OutPutIndicatorID is in ListView.
My code is:
Text='<%#(Eval("OutputIndicatorName").ToString()==""?"N/A" : Eval("OutputIndicatorName").ToString())%>'>
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Feb 24, 2012, 1:16 AM
You can do this in a simple way.
<asp:LinkButton ID="OutPutIndicatorName"runat="server"OnClientClick = 'javascript:OpenFormula(this.id);'
Text='<%#(Eval("OutputIndicatorName"))%>'>asp:LinkButton>
In the javascript function you have to write the following.
function OpenFormula(var ctrlID)
{
if(document.getElementById(ctrlID))
{
alert(document.getElementById(ctrlID).innerText);
}
}
Jignesh TrivediPosted Feb 23, 2012, 11:01 PM
Please try..
hope this help.