What to put in codebehind-file (compare to JavaBea

Results 1 to 2 of 2

Thread: What to put in codebehind-file (compare to JavaBea

  1. #1
    Join Date
    Dec 1969

    Default What to put in codebehind-file (compare to JavaBea

    If you create a JSP-page, you put the calculation part into a JavaBean. The JavaBean is a pure Java-object, and know nothing about HTML-requests and what fields are shown by the JSP-page. <BR><BR>It is up to the JSP-page the access the member variables and create the HTML. A JavaBean can also be used by a non-web Java-program.<BR><BR>However, it seems that in ASP.NET, the codebehind-file extends System.Web.UI.Page, so knows the fields that are shown, it can access the request and stuff like that. <BR><BR>Why is this? My codebehind-files are rather big. Should I split my codebehind files into two classes? One pure, and one that extends System.Web.UI.Page?<BR><BR>Pointers to good examples are appreciated.<BR><BR>Thanks,<BR><BR>mattiasw<BR><BR >---<BR>ExcelEverywhere generates calculating ASP.NET-pages from Excel spreadsheets<BR>

  2. #2
    Join Date
    Dec 1969

    Default Variety of things you can do

    You put all your non UI oriented classes in a separate assembly and reference them from your code behind classes.<BR><BR>You can also inherit the System.Web.UI.Page class in your class library assemblies WITHOUT using code-behind (my preferred method as I hate the code-behind design paradigm).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts