473,396 Members | 1,996 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.

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" AutoGenerateColumns="False"
AllowSorting="False" DataKeyField="myID">
<Columns>
<asp:TemplateColumn HeaderText="Action">
<ItemTemplate>
'''''''NOTE FOLLOWING LINE:
<input Runat="server" ID="SelectedRequest" type="hidden"
NAME="SelectedRequest" />
'''''''NOTE PREVIOUS LINE ^
<asp:Literal Runat="server" ID="litRadioButtons" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Action Message">
<ItemTemplate>
Message:<br>
<asp:TextBox ID="txtMessage" Runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>

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

<input name="grid:_ctl2:SelectedRequest" id="grid__ctl2_SelectedRequest"
type="hidden" />

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

<input name="SelectedRequest" type="hidden" id="SelectedRequest" />

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 2071
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
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...
4
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...
2
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...
3
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...
15
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...
2
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...
4
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...
3
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...
8
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...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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
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.