A CodeBehind error with User Controls

by Terry 6/11/2008 3:29:00 PM

I am updating a website for my project at work. It was a .Net 1.1 site converted to a .Net 2.0 site. We are adding some new user controls to the site. I implemented one of those controls on a new page and generated a runtime error like this:

"The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)"

Hunting around with Google turned up several possibilities, but none helped until I found this link, http://forums.asp.net/t/960707.aspx. A post by ‘Maduka’ suggested changing the Codefile attribute of the page to CodeBehind. This worked in my case. It works the other way too. Change the control’s CodeBehind property to CodeFile.

Without digging deep, I would presume that CodeFile is the .Net 2.0+ code behind method, as this is the default value for the new user controls. So, in our implementation, we are changing pages that use the new controls to use the CodeFile attribute instead of CodeBehind. I am not sure which is best practice, but this is what works for me. Your mileage may vary.

And, it turns out I may have this backward. Reading the posts a bit more indicates that CodeBehind is the new model. I will need to look at this more closely. I am hoping to update the site to .Net 3.5 by the end of the year, and I would like to clean this stuff up.

Currently rated 1.5 by 111 people

  • Currently 1.459461/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Coding Practices | computing

VSLive 2008, Day five

by Terry 5/16/2008 6:53:00 AM

Today the conference is sparsely populated, and hence the network works as advertised. My head is full. This is a figurative and literal truth. I managed to catch a head cold and suffered through the night last night. I have this last day of sessions to sit through on almost no sleep and burning eyes and sinuses. But, I have network, I can check in on the office and keep up with the world.

Today I am attending a session on creating ‘Order from Chaos, leveraging .NET 2.0-3.5’ with Rockford Lhotka as the speaker. Mr. Lhotka made an interesting comment this morning. Basically, code-reuse is not the ideal to strive for because technology is often changing to quickly beneath our feet. It makes sense in the case where I have sever applications that are jointly developed, for example. Overtime, as platforms and coding technologies change, those ‘reusable’ objects we create have to be scrapped or rewritten. Therefore, strive for code reuse only where it will be of benefit.

Ultimately, how you construct your business, data and UI layers make all the difference.

Currently rated 1.5 by 24 people

  • Currently 1.541667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Coding Practices

Improving Team Development, VSLive 2008, Day two

by Terry 5/13/2008 9:04:00 AM

The theme for much of the conference is Visual Studio Team System (VSTS). Improving Team Development, the session I am currently attending, is presented by Mario Rodriguez, the VSTS program manager at Microsoft. Note, while this is largely a Microsoft technology focused conference, most of the presenters are independent of Microsoft, and sometimes subtly vocal about Microsoft’s blunders, as they see them.

An ineffective team has some attributes:

  • Completes (works on) tasks with no business value
  • Divergent or incompatible agendas of the members
  • Incomplete or unknown requirements
  • Poor estimates, late delivery
  • Delivery of low quality software
  • Lack of defined roles of team members
  • Inability or poor team member communication

I have had the fortune to work on both successful and unsuccessful teams. I would agree with this list faults.

Success attributes include delivering customer value as the driver of a project; a top-down approach is constraining by focusing the team on a list of planned tasks. A top-down method is not a bad approach, but it is less efficient. By focusing on the customer requirements throughout the development process, you gain the following successful attributes

  • The customer can evaluate the deliverables
  • Quality assurance is embedded in the process
  • Eliminates process that deliver poor quality code

VSTS tools help produce quality code by enhancing, streamlining and enabling these attributes. Additionally, VSTS has Agile and CMMI templates, which are customizable. I agree with that, to a point. Having the tools available will help, and good tool integration will help a lot (I have to suffer with that where I work). Ultimately, the development team needs to work with these processes.

Currently rated 2.0 by 1 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Coding Practices

VSLive 2008, Day two

by Terry 5/13/2008 8:54:00 AM

I am frustrated with the network access at the conference. Yesterday morning I had great access for the first third of the day then I shut down my laptop during a break. I have not had access since. I learned from the conference organizers they only had five IP addresses being issued for the wireless access. Apparently that has not been fixed – my luck. So, I am writing this offline. If I get it posted, then I found access someplace.

The conference starts formally today, yesterday being pre-conference classes. I have little to comment on the keynote this morning, except one statistic that was mentioned. The speaker said, from years of research by Microsoft, that 35% of all projects fail. This value has not changed over 20 years. What has changed is that the relative cost of failed projects has decreased. In short, development projects have not gotten more successful over time, but just fail more cheaply.

The solution, I presume from the keynote, is integrated team suits like Microsoft Team Foundation Server and Visual Studio will somehow herald in a new era of success. I find that interesting, but I am mostly doubtful. I would agree the integrated development systems are a needed improvement to the development lifecycle. I also believe this will make teams, successful or otherwise, function more effectively, productively and by inference with less cost. This will continue to drive development costs down, making successful and failed projects less costly.

What will not happen, I think, with any tool improvement will be an increase in successful projects vs. failed. I believe the ratio of failures stems largely from the analysis phase of a project, and secondly the architectural phase. Basically, developers are problem solving mechanics and rely on the proper analysis of a problem in order to solve it. Note, I am not saying that developers have no ownership in the failures. Good analysis should include some developer skill set. Errors in the initial analysis will eventually cause cost, quality or schedule problems in the future and no amount of utopian project management and code integration will help that, just make the errors apparent sooner, and therefore less costly.

If you assume the cost of error-recovery in the architecture and development phases can be reduced to almost nothing that projects will be more successful, there may be hope. This will not address poor assumptions or understanding of customer requirements in the analysis. If you don’t know what your customer needs, no amount of money, time or development effort will meet that unknown unless you get lucky. Luck is not a good bet.

If you see this, obviously I found network access. The convention IT folks dropped the network and restarted it.

Currently rated 2.0 by 3 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Coding Practices

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About Terry Losansky

Terry Dee Losansky

I am a software architect, actively practice and teach martial arts and live in Snoqualmie, Washington. I have an amazing daughter who is the jewel of my life.

E-mail me Send mail
Terry's Facebook profile

Calendar

<<  November 2017  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Sign in