"OldButStillLearning" <(E-Mail Removed)> wrote
in message news:1215B07C-3FCD-44B9-AEAF-(E-Mail Removed)...
> I want to write some javascript attached to some event. When the event
> fires, I want to pass the name of a ASP.Net Control to the javascript. I
> happen to be working in a web page which has a master page. What I notice
> is
> that when the page is rendered the ID's of all of the ASP.Net controls are
> altered with what appears to be a prefix. How can I know the ID name so
> that
> my javascript can do a "document.getElementById(controlIDName)"?
Well,
if you're writing javascript code directly in the aspx page you can use
something like this:
....
<asp:textbox id="txtBox" runat="server" .../>
...
<script language="javascript" type="text/javascript">
var clientVisibleTextBox =
document.GetElementById('<%=txtBox.ClientId%>');
...
</script>
--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava