iam writting like this but iam not geeting alert message.
please help me
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 questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Vishal GilbileRank #268 · 9.4K reputationPosted Mar 17, 2013, 9:29 PM EDT
In asp.net when you are trying to access a server side control in javascript you can't directly access the control through its ID you need to make use of ClientID which is automatically generated by Asp.Net engine for every server side control. That means whenever you have to access a server side control in your javascript you need to make use of the ClientID generated by the Asp.net Engine.
just make change in your following line.
var t = document.getElementById('txtdeptdesc').value;
Replace the above line by below line.
var t = document.getElementById('<%=txtdeptdesc.ClientID%>').value;
Hope that solves your problem.
With Regards,
Vishal Gilbile.
Ish BandhuRank #1,415 · 1.2K reputationPosted Mar 17, 2013, 9:35 PM EDT