473,748 Members | 6,370 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Naming Container difference between VS2003 and VS2005

I have an ASP.Net project I developed in VS2003 (ASP.Net 1.1) that works
fine, but when I convert it to VS2005 (ASP.Net 2.0) it's behavior seems to
change. I have the following datagrid in my project:

<asp:datagrid id="grid" runat="server" AutoGenerateCol umns="False"
AllowSorting="F alse" DataKeyField="m yID">
<Columns>
<asp:TemplateCo lumn HeaderText="Act ion">
<ItemTemplate >
'''''''NOTE FOLLOWING LINE:
<input Runat="server" ID="SelectedReq uest" type="hidden"
NAME="SelectedR equest" />
'''''''NOTE PREVIOUS LINE ^
<asp:Literal Runat="server" ID="litRadioBut tons" />
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn HeaderText="Act ion Message">
<ItemTemplate >
Message:<br>
<asp:TextBox ID="txtMessage " Runat="server" />
</ItemTemplate>
</asp:TemplateCol umn>
</Columns>
</asp:datagrid>

When I run this page in VS2003, the line noted above is rendered as:

<input name="grid:_ctl 2:SelectedReque st" id="grid__ctl2_ SelectedRequest "
type="hidden" />

But when I run my converted project in VS2005, it is rendered as:

<input name="SelectedR equest" type="hidden" id="SelectedReq uest" />

What am I missing here? Why isn't the ID of my input control being modified
by it's naming container?

TIA.

Dec 4 '07 #1
5 2083
Hi Monty,

Is this the same code logic as you were using in VS2003 and it worked
correctly?

I have reproduced the issue you mentioned in VS2008. The issue seems
related to accessing the control's ClientID property in the ItemCreated
event. I will do some more research and get back to you later.

Thanks for your feedback.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 7 '07 #2
Hi Monty,

Well, I have just found out it's a known issue of ASP.NET 2.0, we have an
open bug record for it.

Some explanation of this issue:

When ClientID is called, part of the operation is to retrieve the naming
container prefix to return the full client ID (with naming container
prefix), through the calling of UniqueID property. At the time ItemCreated
event is called, the control created in the event has not been added to the
control tree. It is added to the control tree after the event is done in
DataGrid's code. So you observed that ClientID returns only the ID in
ItemCreated event.

In v1.x, the UniqueID is computed everytime the property is called, meaning
that the control would walk up the tree to gather the necessary id prefix
for the naming containers. In v2.0, for better performance, we introduced
some caching code so the control tree walk up would only be done once for
the first time it is being accessed.
As a workaround, we should avoid calling ClientID in ItemCreated event.

If this workaround doesn't work for you, please contact our Customer
Support and Service to see if there will be hotfix available before it's
fully fixed in future versions. We're sorry for the inconvenience caused.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 7 '07 #3
Hi Walter,

Thanks for the research. Do you have KB number for this? Do you know if this
issue is resolved with v3.5?

Thanks again...
Dec 7 '07 #4
For anyone following along, no this issue has not changed in the 3.5
Framework, but I was able to work around this issue by moving my code from
the ItemCreated event to the ItemDataBound event. Good luck!
Dec 9 '07 #5
Hi Monty,

The public KB is under development.

Thanks for your feedback, this will certainly benefit others if they also
encouter this issue.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 10 '07 #6

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

Similar topics

0
1032
by: KCS | last post by:
Hi there. Can you help? My encrypton / decryption routines work fine with exactly the same code if: (a) I encrypt and decrypt with .NET FW 1.1 with VS2003 or (b) I encrypt and decrypt with .NET FW 2.0 with VS2005 but if I try to decrypt a string encrypted via VS2005 but using VS2003 (or the other way round) I get a Bad Data exception.
4
5157
by: Jody Gelowitz | last post by:
Is this possible? I have compiled an assembly in VS2005 and am trying to add a reference to that assembly from my VS2003 project. The error that I am getting is: A reference to '{path to vs2005 dll}' could not be added. This is not a valid assembly or COM component. ONly assemblies with extension 'dll' and COM components can be referenced. Please make sure that hte file is accessible, and that it is a valid assembly or COM component. ...
2
2778
by: -DG- | last post by:
No reply on my previous query, so I'll post this again. I've done a bit more research in the interim. I'm trying to find an easy way to port code from the older VS2003 format to the format used in VS2005. VS2005 uses partial classes to split off the compiler-generated sections of forms. It keeps the editable files uncluttered. I generated very simple projects with VS2003 and with VS2005 to compare the output. Following are...
3
1799
by: Darrin | last post by:
Hello, I see that VS2005 and the new framework 2.0 is out to the public now. Wondering about some things. When you install the new framework 2.0 can a person still use visual studio 2003 or do you need to use Visual Studio 2005? If you can use the new framework 2.0 with VS2003 are there any benifits?
15
4227
by: Joseph Geretz | last post by:
OK, I'll admit it up front - I just don't get it. Here's our previous VS2003 development model. Developers develop the WS solution on their own workstations, using their own IIS web servers mapped to the local devleopment folder. Project compiles to a subfolder .\bin. To deploy, the asmx page and bin subfolder are copied to the production server. So now I upgrade to VS2005. OK, so except for the name, everything is changed. No more...
2
5713
by: Tammam | last post by:
Hello All, I had a solution composed of managed/unmanaged C++ , C# projects. It builds with no problem in VS2003 but after converting the solution to VS2005 i get many linking errors such as LNK2020 LNK2028. Below is a little bit of the error report. Error 34 error LNK2020: unresolved token (0A000029) "public: __thiscall std::_Container_base::_Container_base(void)" (??0_Container_base@std@@$$FQAE@XZ) UnmanagedResiprocateController.obj
4
2101
by: Tony Girgenti | last post by:
Hello. I developed a VS.NET2003(VB), ASP.NET web application client program with ..NET Framework 1.1, ASP.NET 1.1, IIS 5.1 and WSE 2.0. I tried to migrate it to VS 2005 Pro(VB), Web Application Projects, .NET Framework 2.0, ASP.NET 2.0, IIS 5.1, WSE ?. Is WSE 3.0 required for VS 2005?
3
3591
by: Chris288 | last post by:
Hi, I have a problem where our app when compiled in VS2005 runs about 50% the speed it attains in VS2003. This is an unmanaged C++ app. I have tried most combinations of the optimization and language settings with little change in run speed. I compared the generated native code in various places in the code and noticed two things.
8
6164
oll3i
by: oll3i | last post by:
it worked but suddenly when i run it and click a button it throws exception ? D:\SR>java Producent queue1 queue2 queue3 queue4 queue1,queue2,queue3,queue4 javax.naming.NoInitialContextException: Cannot instantiate class: org.exolab.jms .jndi.InitialContextFactory at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6 57) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288 )
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9544
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9324
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3313
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 we have to send another system

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.