473,387 Members | 1,700 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.

Naming controls problem

Hi all. I have the following problem: In an ASP.NET (C#) application i wrote
some client-side script which works with some of the page controls. When the
page content is rendered i see that some of the controls' ids have been
prefixed with "_ctl" and this caused errors in my script. I'm sure my
controls' ids are unique so i don't want the renderer to modify them. Is it
possible to turn this naming feature off?
Please advise.
Best regards.

Nikolay Anestev
Nov 18 '05 #1
2 1218
no. your best bet is to render the client script from the code behind, and
use the UniqueID property of the control, to get the control name.

-- bruce (sqlwork.com)

"Nikolay Anestev" <12*@456.com> wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hi all. I have the following problem: In an ASP.NET (C#) application i wrote some client-side script which works with some of the page controls. When the page content is rendered i see that some of the controls' ids have been
prefixed with "_ctl" and this caused errors in my script. I'm sure my
controls' ids are unique so i don't want the renderer to modify them. Is it possible to turn this naming feature off?
Please advise.
Best regards.

Nikolay Anestev

Nov 18 '05 #2
Thank you for your advise. But there is something more. The name for the
form is changed to "_ctl0:ctl0" and this causes errors in the automatically
generated sripts for the post back.
I can't prevent this.
Regards.

Nikolay
"bruce barker" <no***********@safeco.com> wrote in message
news:Oc**************@TK2MSFTNGP12.phx.gbl...
no. your best bet is to render the client script from the code behind, and
use the UniqueID property of the control, to get the control name.

-- bruce (sqlwork.com)

"Nikolay Anestev" <12*@456.com> wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hi all. I have the following problem: In an ASP.NET (C#) application i

wrote
some client-side script which works with some of the page controls. When

the
page content is rendered i see that some of the controls' ids have been
prefixed with "_ctl" and this caused errors in my script. I'm sure my
controls' ids are unique so i don't want the renderer to modify them. Is

it
possible to turn this naming feature off?
Please advise.
Best regards.

Nikolay Anestev


Nov 18 '05 #3

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

Similar topics

3
by: Patrick Kristiansen | last post by:
Hello group! If a company is called for examle ABC, what would be the best practice for naming a namespace. Which one of the following is preferred according to Microsoft guidelines: ...
1
by: Lalit | last post by:
Hi Friends, We are defining coding standards for our company. In MSDN i have seen that hungarian notation will not be used in naming of variables etc. What about the controls ? Should we...
4
by: Mark Broadbent | last post by:
stupid question time again to most of you experts but this is something that continually bothers me. I am trying to get into the habit of naming variables and controls in an assembly as per...
6
by: Manuel Lopez | last post by:
Hello, I have a Web Project (UserControls.dll) with some user controls that is shared by many asp.net web applicattions. What we do is copy UserControls.dll to all the applications bin...
4
by: =B= | last post by:
Hi, I was wondering if anyone has any opinions on naming conventions for ASP.NET objects? Up until now I've been using txtThis for Text Boxes, ddlThat for DropDownList, etc because I think it...
4
by: Patrick | last post by:
what are the general naming conventions for vb.net controls. esp txtUserName, lblPassword, btnSubmit What are the prefixes for the controls???? I've tried to search hi and low on the net, but...
9
by: kevininstructor | last post by:
Greetings, I am in the process of creating naming conventions for VB.NET controls i.e. CheckBox -> chkShowThisOnStartup ListBoxt -> lstSomeList What I am looking for other developers...
4
by: Sturdy | last post by:
Hi, I'm new to C# and .NET. I'm a first time user of Visual C# 2005 Express and have a very basic question. I've looked at several links and lots of docs but can't find any tips on naming multiple...
3
by: Nathan Sokalski | last post by:
I have written a custom control that uses AJAX (it implements IPostBackDataHandler and ICallbackEventHandler). I have tested it, and it seems to work the way I want. However, when I used it in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
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...

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.