Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

Visual Studio .Net 2003 Project running in IIS with ASP.NET 2.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
clockemail@alltel.net - 29 Jun 2007 21:07 GMT
I have a VB ASP.NET project that was compiled using Visual Studio
2003, and which works perfectly when using ASP.NET 1.1 in IIS.
However, if I run IIS with ASP.NET 2.0, controls within repeaters
become relabeled, which leads to bugs in my JavaScript code. For
example, a textbox that is labeled as rptDiag__ctl1_txtVersion in the
source code when ASP.NET 1.1 is used, appears as
rptDiag_ctl01_txtVersion when ASP.NET 2.0 is used. Would I be right to
assume that I should accept that ASP.NET 2.0 should not be used with
Visual Studio 2003 projects?
bruce barker - 29 Jun 2007 22:53 GMT
no. its a coding bug. controls are dynamically named, so you should
never view source to get the name, but use the ClientID on the server.

<script>
var myControl = document.getElementById('<%=myControl.ClientID%>');
</script>

-- bruce (sqlwork.com)

> I have a VB ASP.NET project that was compiled using Visual Studio
> 2003, and which works perfectly when using ASP.NET 1.1 in IIS.
[quoted text clipped - 5 lines]
> assume that I should accept that ASP.NET 2.0 should not be used with
> Visual Studio 2003 projects?
clockemail@alltel.net - 30 Jun 2007 00:25 GMT
I am referring to the controls as I have entered them in my VB code,
which works fine when the project is run under ASP 1.1 in IIS, but
when run under ASP 2.0 in IIS, bugs occur in the JavaScript because
the controls have been relabeled (by ASP 2.0, not by me).

> no. its a coding bug. controls are dynamically named, so you should
> never view source to get the name, but use the ClientID on the server.
[quoted text clipped - 17 lines]
>
> - Show quoted text -
Teemu Keiski - 30 Jun 2007 12:22 GMT
As Bruce said, you shouldn't refer them, since ASP.NEt does renaming of
control ids based on how they are contained in naming containers etc. The
reliable way is to use ClientID, it is meant for client-script scenarios.

Signature

Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

>I am referring to the controls as I have entered them in my VB code,
> which works fine when the project is run under ASP 1.1 in IIS, but
[quoted text clipped - 22 lines]
>>
>> - Show quoted text -

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.