Re: TRICK: methods in ASPX pages with <%%> code blocks



Hi Marina,

I find the 2 arguments you listed more then enough to support the
reasons for doing it. Except with the change, that it more the
promotes thinking about these 2 things as separate.  There is a lot to
be said from separating your UI from the business logic.

I am all for the seperation of logic and presentation and business logic should defenetily go into its own space regardless of how small the project is.
But the little code you write for wiring things up, ie that are specific to the GUI, don't need seperation cause its specific and thus not reasuable.


A function that gets all orders from a database should be in a class library (and I mean not code behind).
IMO A function that wires up the result to a datagrid doesn't have to be in a class.


BTW Everything in ASP.NET is a class. The aspx file too. It gets transformed by a parser to a plain class :

http://dotnetdan.com/articles/aspnet/FirstPrinciples.htm
http://dotnetdan.com/articles/aspnet/DataBinding.htm

So by that rational I do everything in a class file so I must be doing it right ;)

And sorry, but your reasons for not doing just don't make sense to me.
I don't care if I have 100 files or 50 files.  You still just see one
icon in VS, and you can either go to design view, or you can go to
code.  You don't see twice as many files - so who cares if in reality
there are?

I hear you but I like to keep everything KISS. So there must be a _good_ reason if I have to double the project in files.


In any case, microsoft didn't limit anyone to any one model of how
things should be done. If this way works for you, go ahead.

The arguments you make are all solid but for me the separation between markup and wire up code (not Business Logic) is a logical one.
You can make it a physical separition by splitting the file in 2. But what does it give you? IMO not more power, except for the 2 reasons that are only a consequence of making it physical.


Cheers,
Tom Pester


.



Relevant Pages

  • Re: Abnormal Normalization?
    ... see a reason to have a separate "person" table. ... do that myself - for several reasons. ... admit the idea of an employee also being a contact (which i've always used ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Extras on TV Show Complete Series sets
    ... especially when it's something as important as the sequel movies. ... Wild, Wild, West - ditto ... all of the separate season sets. ... They've pissed off enough people for enough different reasons ...
    (rec.arts.tv)
  • Re: Moving /home
    ... supposed to be related to the reason /root and /home are separate on the same ... most other *NIXes), physical drives are irrelevant, security is controlled ... There are good reasons to separate /home from the rest of the filesystem, ... a RAID array, drives can easily be added to the array to transparently ...
    (comp.os.linux.setup)
  • Re: modernization of FORTH, Age Results
    ... not separate arguments from local values. ... Why is it necessary for the language to make such ... Two reasons: ...
    (comp.lang.forth)
  • Re: Typedef structs
    ... > What reasons would you offer that it shouldn't be hidden? ... In a separate ... the type "struct tm", declared in, is visibly a struct. ... over brace style. ...
    (comp.lang.c)

Loading