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 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsForums
Top experts
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 23, 2012, 6:01 PM EST
Please try..
hope this help.
SenthilkumarRank #387 · 6.5K reputationPosted Feb 23, 2012, 8:16 PM EST
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);
}
}