newb coming from CF

Last post 03-11-2008 4:04 PM by commadercody. 3 replies.

Sort Posts:

  • newb coming from CF

    01-08-2008, 8:39 AM
    • Member
      point Member
    • lukenukum
    • Member since 01-08-2008, 12:27 PM
    • Posts 2

    hi folks,

    im finally making the plunge and learning asp.net bit by bit (quite literally it feels sometimes!). i am (or was) diehard coldfusion developer but am moving into asp.net to up my skillset and hopefully become more object oriented.

    being someone who's used to just wacking open a .cfm page and working top to bottom with a fusebox type methodology im finding it a little difficult to get my head round some of the very basic foundations of the way the server works... my head keeps going back to "well in coldfusion i'd do it like this, whats all this extra stuff, hmmm, am i putting this in the ideal place for the job".

    im working on a basic web app with a code-behind page...

    a) i've got a web.config page with a connection string it... is this where i would store such things as session variables? ie - is the web.config available all the time to the app, or just when the page is first called?
    b) at the moment i seem to be putting everything into the Page_Load subroutine (my old top to bottom approach) - is this good normal practice or indeed required?
    c) do SqlDataReaders only work when the SqlConnection is open or is the output cached anywhere? cf would hold a resultset which you could pull at anypoint on the page.
    d) how do you know if your page has too cumbersome and needs breaking up into new pages?

    oh dear, so many questions have i!

    i'll call it a day there - any advice, tips, basic methodolgy, diagrams, alcohol etc for a cf developer making the move greatly appreciated!!!

    cheers,

    Luke



  • Re: newb coming from CF

    01-08-2008, 9:30 AM
    • All-Star
      20,998 point All-Star
    • Jeev
    • Member since 11-24-2005, 12:49 PM
    • Posts 3,163

    Hi Luke.. let me try to answer your questions

    ) i've got a web.config page with a connection string it... is this where i would store such things as session variables? ie - is the web.config available all the time to the app, or just when the page is first called? -- Web.config is not where you would store session variables.Session variables are infact stored in the server memory and the values are user session dependant, hence the name session variables .The values in the web.config ie connectionstring, appsettings etc are available to you at any time you need them in code

     at the moment i seem to be putting everything into the Page_Load subroutine (my old top to bottom approach) - is this good normal practice or indeed required? -- You would be better off splitting it into  methods depending upon what functionality you wish to accomplish. Also depending on the need to do certain things at certain times in the page lifecycle, you can put things in the init, Prerender events etc to name a few

    c) do SqlDataReaders only work when the SqlConnection is open or is the output cached anywhere? cf would hold a resultset which you could pull at anypoint on the page.-- SqlDataReaders work only when the connection is open and by default output is not cached. Could you load the information into a table which is a page level variable if you need it at multiple places

    d) how do you know if your page has too cumbersome and needs breaking up into new pages? -- Well you have the concept of user controls to break a single page into multiple pieces.

    I'd suggest looking at some tutorials that are available on this site just to familiarize yourself with the new concepts

    Hope this helps and all the best on this new journey. I'm sure you will enjoy it

     

    Jeev
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If you get the answer to your question, please mark it as the answer.
  • Re: newb coming from CF

    01-08-2008, 9:57 AM
    • Member
      point Member
    • lukenukum
    • Member since 01-08-2008, 12:27 PM
    • Posts 2

    hi Jeev,

    thanks for getting back to me so soon!

    > Session variables are infact stored in the server memory and the values are user session dependant,
    > hence the name session variables .The values in the web.config ie connectionstring, appsettings etc
    > are available to you at any time you need them in code

    yes, sorry... i think what i was trying to get at was is the web.config like and application.cfm.

    > you would be better off splitting it into  methods depending upon what functionality you wish to accomplish.
    > Also depending on the need to do certain things at certain times in the page lifecycle, you can put things
    > in the init, Prerender events etc to name a few

    more reading up here then!

    > SqlDataReaders work only when the connection is open and by default output is not cached. Could you
    > load the information into a table which is a page level variable if you need it at multiple places

    interesting, i shall look it up.

    > Well you have the concept of user controls to break a single page into multiple pieces.

    yes, the more i use it i guess things will become clear.

    > I'd suggest looking at some tutorials that are available on this site just to familiarize yourself with the new concepts

    yep, have been... its just i seem to be in a middle ground of knowing what i want to achieve and being able to do it in many ways but the syntax is foxing me a bit.

    > Hope this helps and all the best on this new journey. I'm sure you will enjoy it

    sure does, many thanks for the reply... i've got a couple of books on the way so hopefully i'll get up to speed at somepoint...

    cheers,

    Luke

  • Re: newb coming from CF

    03-11-2008, 4:04 PM
    • Member
      190 point Member
    • commadercody
    • Member since 03-21-2007, 10:23 AM
    • Posts 332

    Luke,

     Make sure you use the AJAX control toolkit, it will make your migration that much easier.  I have to admit that four years ago when I left CFML and it paid my bills since 1997 I was a little scared.  But, now, I don't even think about going back.  Just take a look at the toolkits, simple open and close tags just like <cfquery> :)

    "From my point of view, the Jedi are evil!"
Page 1 of 1 (4 items)