473,473 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP.NET 2 UserControls

Greetings,

We have a application that was recently migrated from ASP 1.x ==> ASP 2.0
(I'm sick of saying .NET after everything so just know that I'm talking
about .NET). We have <INPUT /> controls on the UserControl. We also have
tons of JavaScript all over the place, some hardcoded, some autogenerated
that refer to these controls when rendered.

In ASP 1.x, the HTML was rendered of the form <INPUT
name="usercontrol_inputcontrol" id="usercontrol_inputcontrol" />

But in 2, it renderes <INPUT name="usercontrol$inputcontrol"
id="usercontrol_inputcontrol" />

And all over our javascript is broken. I really don't want to change
thousands of different locations to findbyid on the name as that makes for
harder to read code and will be very timeconsuming to track all the places
down the need to be changed. Do we have any control over the rendering? Is
there a way we can make it emit the name the way it used to so that
backwards compatibility isn't sacrificed for the time being?

We've had nothing but hardships updating our web to 2.0. Took 20
programmers full-time almost 4 weeks to finally get our (1000 pages) ASP.NET
1.x application to function in 2 and even then, we still keep finding these
"little" things all over the place. Many times we almost made the decision
not to migrate to 2.0 because of the shear number of differences between 1.x
and 2.0 (ASP.NET) that need to be addressed before we can even run the
website on a staging server). Its annoying, I tell ya, annoying. And for
all that, we still may not because the migration has been so costly. We
aren't making progress on the bugfixes or other enhancements because of this
extravaganza.
Thanks,
Shawn
Mar 30 '06 #1
2 1545
I agree, the migration to 2.0 is smooth only if you don't try to
combine .NET output with any external languages/markup.

I'm in the same boat, and the path I'm heading down is a custom class
that can take a page, loop through its controls, and generate
javascript along the lines of:

var {ClientID} = document.getDocumentById["{ClientID}"];

A bit of a hack, but then I can consistently refer to form fields via a
simple syntax, and not worry about how they're actually generated.

Mar 30 '06 #2
> I'm in the same boat, and the path I'm heading down is a custom class
that can take a page, loop through its controls, and generate
javascript along the lines of:

var {ClientID} = document.getDocumentById["{ClientID}"];

A bit of a hack, but then I can consistently refer to form fields via a
simple syntax, and not worry about how they're actually generated.


This might not be a bad idea, after all. But we'd have to change in so many
places. I figured out how to make it work... most of the code I work on has
always used the document.forms[0]. ... syntax for identifying form elements.
Code I have not worked on used the document.Form1. ... syntax. This was one
of those cases. In ASP.NET 2, it is "form1" (lower-case F) which caused the
problem.

I'm all for change and progress. But when Microsoft expects us to upgrade
and migrate to the latest and greatest, they should at least do more than
pay lip-service to compatibility. ASP.NET 2.0 is so drastically different
from 1.x... even their own migration wizard failed to convert the site.
Their rendered output isn't friendly to client-scripting, either. For
example, we can't use MasterPages in our site where it would make the most
sense and give us tremendous benefits because, we would have no way to
predict how the Javascript should reference the controls on the Master page
because it tries to uniquely name each thing. Prudent, I suppose. But they
need to not assume that I'm an idiot. I know what I'm doing. Thus, we
can't store any client script in the Master Pages. Well, then Master Pages
are useless for our site and the design of our site won't change to fit into
the tiny little box MS wants us to be in. Our web application is so much
bigger than their vision, appearantly.

But, in all, apart from ASP.NET, the migration was smooth. Unfortunately,
our applications is Web based, thus its a problem.
Thanks,
Shawn
Mar 30 '06 #3

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

Similar topics

4
by: Anders K. Jacobsen [DK] | last post by:
Hi I have some common UserControls i want to share between to sites (on the same mashine but on diffrent virtual paths). right now i have on solution file with aprox 10 projects. 2 of these is...
4
by: Nathan Sokalski | last post by:
In several of my UserControls I add properties. If I access these properties in the CodeBehind of the pages that use the controls, I recieve an error when compiling. The reason for this is because...
5
by: Nathan Sokalski | last post by:
In several of my UserControls I add properties. If I access these properties in the CodeBehind of the pages that use the controls, I recieve an error when compiling. The reason for this is because...
4
by: Nathan Sokalski | last post by:
In several of my UserControls I add properties. If I access these properties in the CodeBehind of the pages that use the controls, I recieve an error when compiling. The reason for this is because...
7
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows...
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.