Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
JavaScript problem
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
OS:
Windows XP
Miscellaneous
Thread ID:
01300544
Message ID:
01301082
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
Ah... you're using a master page. You need to either use the 'complex' id or
var ctl = document.getElementById("<%= this.txtControl.ClientID %>");
to embed the value correctly.

+++ Rick ---

>>Script like this is usually placed in 'startup code' which is a script block just before the form tag.
>>
>>That works in most cases or alternately you need a real startup handler like hooking < body onload="" > or using a javascript library like jQuery to reliably tell when the document's properly loaded.
>>
>>Overkill in your situation - you can just use the startup script block on the bottom of the page and that will work fine.
>>
>>+++ Rick ---
>
>My problem is what tblProInfo is the name from the Server. In the HTML code I see
>ct100_ContentPlaceHolder1_tblProInfo instead.
>
>Can I pass the ClientID to the JavaScript from OnCLientClick. Right now I created a little function HideElement
>
>
><script type="text/javascript">
>function HideElement(what)
>  {
>  var x = document.getElementById(what);
>  //alert(x);
>  if (x) {
>     x.style.display = "none"; }
>  }
></script>
>
>And I call it from ASPX OnCLientClick "HideElement('tblProInfo')". I need to pass ClientID here instead.
>
>Thanks a lot in advance.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform