473,473 Members | 2,286 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to get clientid in external js file

2 New Member
I can't get the clientid when using as external js file. Please help how to resolve this issue.
Mar 5 '15 #1
3 1735
Dormilich
8,658 Recognized Expert Moderator Expert
what clientid?
Mar 5 '15 #2
dhamodaran
2 New Member
Inline JS:
==========
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. function test()
  3. {
  4. var getValue = document.getElementById('<%=TextBox1.ClientID%>').value;
  5.  
  6. alert(getValue);
  7. }
  8. </script>
  9.  
  10. <asp:TextBox id="TextBox1" runat="server" />
  11. <asp:Button value="submit" id="btnSubmit" onclientClick="test();" /> 
While button click event i can get the Textbox values. When i move into separate js file i can't get TextBox value.

How to do it ?
Mar 6 '15 #3
Dormilich
8,658 Recognized Expert Moderator Expert
the JavaScript code is created by ASP. if you move it externally, ASP can’t set the ID value needed.
Mar 6 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: George Ziniewicz | last post by:
.. I have an html file with javascript functions in the <head> section that work fine when called from events or instanced as objects. When I move the functions to an external js file they don't...
1
by: mr_burns | last post by:
Hi, i was wondering if it is possible to load text into a string from an external text file. the reason is that i have a very large string and it is making my script very messy. also, is it...
2
by: Hugh Macdonald | last post by:
I'm writing a tool at the moment that reads in an external file (which can use any Python syntax) At the moment, I'm reading the file in using: scriptLines = open(baseRippleScript).read()...
8
by: Flip | last post by:
I have a website that's using Master pages (very cool). But when I put JS on there (to close the browser for example) coming from an external file, when I navigate away from the first page, the JS...
1
by: teddarr | last post by:
I'm having trouble reading the first 2 lines of data in an external file. I am supposed to use a while loop to read the first 2 lines of an external file that contains several random integers. I...
5
by: johanneskrueger | last post by:
Hello, I'm currently using <xsl:copy-of select="document(...)/svg:svg"/to embed an SVG file into an XHTML file. I already defined the SVG namespace and assigned svg as its prefix in my XSLT 1.0...
2
by: iamdennis | last post by:
Hi all. I stuck here and need some help. I have created a combo box which contains a list of links to external PDF files. I also created a OPEN command button next to the combo box. I want to...
0
by: John Goluch | last post by:
I am using an external .txt file with a Flash website template and have a couple questions... 1. How (if this is possible) can you comment out things in the external .txt file? 2. Is it...
2
aquagirl20
by: aquagirl20 | last post by:
I'm new in using tables. I have a series of getter methods and I wants to display them in a table. I've been trying to use the external file that my program saves but I'm having a hard time how to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.