473,398 Members | 2,335 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,398 software developers and data experts.

how to use Castle Windsor with ASP.NET webforms?

ssnaik84
149 100+
Hello,

I googled for Castle Windsor usage, but, I got examples of ASP.NET MVC / MonoRail.

Can you please explain how to use Castle Windsor with ASP.NET webforms?


Thanks in Adv.

Swapnil
Sep 29 '09 #1
4 4653
Frinavale
9,735 Expert Mod 8TB
Hi Swapnil,

I just looked into the Castle Windsor project and discovered that it is supposed to be used in systems that are designed using the Inversion of Control principle.

The Inversion of Control principle is pretty cool. It lets you uncouple the application layers so that they aren't dependent on one another.

Model View Controller (MVC) operates with the same principle...it lets you uncouple the different application layers so that each individual part can do it's own thing without depending on the other layers.

ASP.NET web forms won't let you do this. The applications layers are much more tightly bound and it's....well, not as clean as MVC (or the Inversion Control Principle).

I don't know very much about the third party controls that Castle Windsor produces, but reading their intro page leads me to believe that it will be very difficult to use their controls in a regular ASP.NET web forms application.

Upgrade to MVC.
I think you'll be pleasantly surprised :)
I know I was when I first started checking it out....I haven't had a lot of experience with MVC but I know that it is a lot better than regular ASP.NET web forms because it uncouples the different application layers so nicely.

-Frinny
Sep 29 '09 #2
ssnaik84
149 100+
Hi Frinny..

I'd already given a try to MonoRail and ASP.NET MVC...
they are cool.. personally, i like MonoRail.. and i'm a big fan of Ayende
but problem is.. we cant use server controls. we have to work in classic asp age... regular asp.net development is much faster.
that is why.. i'm searching for golden middle..

Do you know about MVP (ASP.NET Web Forms Model-View-Presenter)?
Can you guide me on this topic?

Thanks!!!
Sep 29 '09 #3
Frinavale
9,735 Expert Mod 8TB
Sorry but I don't know anything about MVP.

Finding a middle ground for MVC and web forms is probably going to be pretty hard.

I personally don't like the idea of using controls in MVC because of the nature of controls....

Controls sit between different application layers. This means that MVC's desired uncoupling design will be lost. This means that the nice, neat and tidy, testable units will not be available...that is a huge thing to lose. Not only that but controls have their own events, and a lot of the time handle their own events too. They gobble up events instead of letting them be handled by the layer/class that should be handling it. Again, making them less testable than the tidy-testable units that you'll have when you use pure MVC.

I know that we've been spoiled by .NET controls...MS came along and gave us a bunch of tools that helped us to quickly develop things.

But these controls are very bulky (depending on viewstate etc), and a lot of them are so out of date that you can't do anything with them client side (don't get me started on this issue... I almost gave up on .NET once because it).

MS has stopped evolving these controls and hasn't kept them up to date with the new web standards of today.

Controls are not your answer....if you start using them you're going to be working backwards not forwards.

I should probably tell you that I too am dependent on controls. I develop server controls all the time to take care of things in my web forms applications. But I understand the their true, horrible, nature. I see how they are not the best design and sometimes I feel dirty/bogged down using them. I understand that MVC is hands-down better and would recommend it's design to anyone as apposed to web forms and controls.

I haven't yet taken the plunge into MVC completely but I'm extremely interested in it because it doesn't use controls. I know that when I do start using MVC it's going to require me to adopt a completely new and different mindset when it comes to developing web applications. I'm very excited about it...I'm hoping to start using it within the next couple of months.

I'm not sure what to suggest because I'm not quite at the stage you are with respect to developing using things like MVC or MVP.

But what I do know is that controls are absolutely the wrong things to become dependent on. They are bulky, less testable because they sit across application layers, outdated and not properly maintained so tend to be behind web standards....I could go on about the evil nature of these things but I don't think you'd truly understand unless you had tried extending upon these outdated beasts.

Stick with the "new-old-asp" style...it may feel like you're moving backwards but you are actually moving forward...keep your code clean, and in testable separate layers by using MVC and leave controls to decay as the dinosaurs that they are.

-Frinny

PS if you insist on using controls I'll still try to help you out...but I've never used them in MVC and don't know how helpful I'll actually be.
Sep 29 '09 #4
ssnaik84
149 100+
I know that we've been spoiled by .NET controls...
Yes.. I am!!! that's why i couldn't make my mindset to switch @MVC pattern.

well.. I'm really.. heartily thankful to you for such a great guidance.
now i'll again surely take a look at ASP.NET MVC.
thanks.. thanks a million :)

btw.. you must be knowing but MvcContrib is a very good initiative towards ASP.NET MVC enhancement

-- Swapnil
Sep 30 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: rachel | last post by:
Hi all, I am new in ASP.Net. I have a question on link multiple web forms together. Here is the scenario: I create an Index.aspx WebForm which consists of a banner and three navigator...
1
by: Paul R | last post by:
Hi, I have a Winforms application that access some SQLServer2000 stored procedures. I have now written some new Webforms pages to use some of the same stored procs. The Webforms use the SAME...
20
by: Martin Rosén-Lidholm | last post by:
Although an impossible question to answer, I fell urged to raise it anyhow. Given a fairly complex ERP application scenario, what's your estimation for the X-ratio dev. time for...
2
by: Piotr Karwatka | last post by:
Hi! I have a little problem an qeustion. In .NET Windows Forms I can do something like that: - i have forms - Form1 Form2, on first form i have TextBox1 control on 2nd form I have Button1...
4
by: 3Cooks | last post by:
I have a windows application written in Visual Basic 6.0 that is going to be redeveloped in dotNET. We are trying to decide if we should deploy using Webforms or Winforms and I need advice from...
5
by: Bit byte | last post by:
Can I use C# (Winforms) to design a website?. I am from C/C++ background but know nothing about Internet programming. My understanding of WebForms are that they are similar to WinForms in that...
10
by: SushantK | last post by:
hi i m a newbie,sushant could anyone please help me out with this problem?? Chambers in a Castle The floor plan of a castle indicates where the walls are. The outer boundary of the castle is...
1
by: roundcrisis | last post by:
hi there: Just wondering if there is an interest to meet up in Ireland(in in Dublin) and talk about the castle stack, similarly to alt.net I find that meeting up makes knowledge exchange faster...
1
by: westwolf2010 | last post by:
The code segment below is in VB.net and referencing C# Bouncy Castle libraries. I get the same results when the VB code is in C#. Exact same Console output of EncryptKey and exact same "incorrect...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
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...

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.