473,396 Members | 1,764 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,396 software developers and data experts.

get generated id of a control?

hi,
in .net when i have a hyperlink control in a datagrid, i set it's ID
on the page to Hyperlink1. but when i check it's ID when viewing the
source of the web page i get this:
dg_ctl02_Hyperlink1
isn't there someway to know what .net generated before the ID i put in
the code, i mean this part:
dg_ctl02_
Sep 30 '08 #1
2 1754
<so******@yahoo.comwrote in message
news:6a**********************************@k13g2000 hse.googlegroups.com...
In .Net when I have a HyperLink control in a DataGrid, I set its ID
on the page to Hyperlink1. But when I check its ID when viewing the
source of the web page I get this:
dg_ctl02_Hyperlink1
Yes, that ID munging is standard behaviour.
Isn't there some way to know what .Net generated before the ID I put in
the code? I mean this part:
dg_ctl02_
document.getElementById('<%=Hyperlink1.ClientID%>' );
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 30 '08 #2
Well, if you do like most people, you simply add the dg_ctl02_ in a hard
coded manner. ;-)

Mark has already answered the correct way. While you are still server side,
pull the ClientID.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
<so******@yahoo.comwrote in message
news:6a**********************************@k13g2000 hse.googlegroups.com...
hi,
in .net when i have a hyperlink control in a datagrid, i set it's ID
on the page to Hyperlink1. but when i check it's ID when viewing the
source of the web page i get this:
dg_ctl02_Hyperlink1
isn't there someway to know what .net generated before the ID i put in
the code, i mean this part:
dg_ctl02_
Sep 30 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
0
by: DotNetJunkies User | last post by:
Hi All I am developing a site using ASP.Net I want to develop a site that generates forms ( textbox,check boxes etc) automatically ie is from database itself depending on the no of rows in the...
4
by: clintonG | last post by:
Technically speaking, this issue is not about modifying the HTML generated by server controls but preceding the HTML generated by server controls with an HTML control generated on the basis of the...
1
by: Peter McEvoy | last post by:
Hi all, another question related to Schema and WSDL... I'd like to have a bit more control over the WSDL that is generated for my ..asmx. In particular, I'd like to override the generated WSDL...
1
by: Ellis Yu | last post by:
Dear all I would like to know how to refresh the coding which is generated by .Net when I put my custom control on the form. Since the setting of control may often change during development, I...
5
by: Charts | last post by:
I recently upgraded to VS2005. I noticed that in ASP.NET project, the system generated codes are missing from default.aspx.cs file. While I used to be able to see it in VS2003 project. Now, if I...
2
by: sanjib.prasad | last post by:
Hi, I am working with new web based control tool. To make a new tool of accordion of mulitpanel. What happen when i creating any sub panel under top panel. then system create a run time...
3
by: Rolf Welskes | last post by:
Hello, this is a hint only. If you make a custom control for example witch generates code <div......</div> and I put such a control in a page then in html-view of the aspx-file I could...
2
by: Andy | last post by:
Hi, I have an ASP.NET webpage that contains an ASP.NET XML control. This control accepts an XSLT stylesheet and XML document which it then uses to render HTML code where the XML control is...
13
by: cj | last post by:
In a project done in 2003 about a year ago I was told to add the SocketWrench code below into the Windows Form Designer generated code area as shown below. #Region " Windows Form Designer...
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: 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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.