Posts Tagged ‘web’

Are Server Controls Still Useful?

// October 15th, 2008 // Comments Off on Are Server Controls Still Useful? // .net,

Dino Esposito wrote an article about how useful are server controls nowadays.  In my opinion, Server Controls have a place in the world. But as always, you have to take the requirements into consideration before choosing the technology to use.

Server Controls Advantages:
* Enhanced Productivity: It is very easy and fast to use server controls in ASP.Net, a lot of work went into creating such controls, and they are extremely useful and easy to use.
* HTML Uniformity: In ASP.Net Server Controls can be added with just like simple HTML tags, which makes your code uniform.

Server Controls Disadvantages:
* Not for High Performance Expectations: This doesn’t mean that Server controls have very low performance, it is just not for the use as high performance tool. The easy of use they provide, hit the performance as most of the time.

I Googled a little bit more and found this great article which explains the Pros and Cons of using Server Controls in a more comprehensive list.

Profiles and Web Applications

// April 19th, 2007 // Comments Off on Profiles and Web Applications // .net,

I was recently migrating a project from a Website Project to a Web Application Project (WAP) in Visual Studio 2005. This is completely new to me, since I’m mostly a Middle Tier fan. So we had extensive use of Profiles in our Website project, and when migrating the application broke. Specifically code that was in Code Behind had compilation errors while trying to find the Profile object.

Since this object is compiled and instantiated at run-time, VS didn’t seem to find it. So this I spent several hours trying to find a solution, and the only one I could figure out, was to write the damn Profile class, and included it in my project, so I began doing that., when I was about finished with my Profile implementation, I found this article.

As it seems the main reason why this doesn’t work is because of the way Web Applications are compiled. This is the complete answer provided by one of the Asp.Net Team in this forum:

This is not so much a bug as a difference in compilation models between web sites and web application projects. See the profile topic in the following for some more info:

The basic issue is that profiles are compiled dynamically by ASP.Net. In web sites your code files are also compiled dynamically by ASP.Net. So, ASP.Net is able to first compile the profiles and then add an accessor and reference to your page and compile it afterwards. In Web Application Projects your code files are compiled on the client. They can not have references to dynamically created assemblies that do not exist or they will not compile.

This is a general issue for ASP.Net BuildProviders and and Web Application Projects. We do not have a general solution yet. The two build providers we get the most questions about are App_GlobalResources and Profiles. For these two we are trying to come up with solutions. The thought is that we will generate proxy opjects that get compiled into your assembly on the client. The proxy objects for profiles will represent the state of the profiles in web.config at the time of compilation on the client. You will have strongly typed access to the profiles through the proxy. The proxy will work something like the sample code in the link above.

Tim McBride

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

Also in that forum, there is an Add-in to generate the Profile for Web Applications. I already installed it and tested, it works like a charm. It is not as seamless as I would like, since I have to instantiate the the Profile for each page, but it works. The Add-in is here.

I hope this helps, because I spent too many hours looking for a solution. And there is not enough information to make it work correctly.