473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

not getting clientid by using external js

8
i have var mycontrol = <%=newcontrol.ClientId%>.id; in my aspx page
and i have an external .js file
but by uisng in this way i am not gettiing the clientid of the new control.
can anybody help
Dec 29 '08 #1
2 1855
Dormilich
8,658 Expert Mod 8TB
how is the asp (server side) and the javascript (client side) connected?

regards
Dec 29 '08 #2
acoder
16,027 Expert Mod 8TB
You will most likely get an error with that code. The Client ID will be a string, but in JavaScript it will look like a variable name (which most likely doesn't exist), so add quotes around it:
Expand|Select|Wrap|Line Numbers
  1. var mycontrol = "<%=newcontrol.ClientId%>";
Dec 31 '08 #3

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

Similar topics

4
by: New Guy | last post by:
I'm trying to work with a system that somebody else built and I am confounded by the following problem: There is a table of payments and a table of charges. Each client has charges and payments...
2
by: Neo Geshel | last post by:
After pouring over about a dozen sites that clearly dealt with ClientID all by itself, I came to the realization that about 2/3+ of them were doing it wrong. It is indeed impossible to grab the...
2
by: JJ | last post by:
Hi, Can anyone advise me how is the ClientID issued? I had a suite Controls which consist of a context menu (i.e. a group of tables, rows and cells situated in a class library) and a set of...
0
by: Vikram | last post by:
is someone has faced this kind of problem... I am using clientid porperty of server control in this manner in a javascript alert('<%=txt.clientid%>') now first time it give some spaces in the...
0
by: Adam Clauss | last post by:
OK, I have page with nested gridviews (.NET 2.0). So, the controls that exist within these grids get some unique ID assigned to them when sent out to the browser. I have javascript code which...
2
by: DC | last post by:
Hi, I am doing something like this in the ItemCreated event (ASP.Net 1.1): DataGridItem pagerRow = e.Item; TableCell pagerCell = pagerRow.Cells; Control addedControl = new Control();...
2
by: Nathan Sokalski | last post by:
As most of us probably know, ASP.NET controls do not use an exact copy of a control's ID for the HTML element's name or id attribute. When generating JavaScript as part of a control or event, we...
1
by: MarkShoe | last post by:
Hi, I have an aspx with a control on it, lets call it myControl, and I have an external javascript file. In the external javascript file, I have var myControlId = '<%=myControl.ClientID%>';...
1
by: aloksingh83 | last post by:
This error coming when i am using telerik grid.It works fine in asp.net grid what i am trying to do is taking values from textbox and show in grid view... here is the code: <script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.