Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Feb 2005
    Posts
    190
    Thanks
    25
    Thanked 0 Times in 0 Posts

    ASPX MSSQL Query

    Hi there
    I am a total newbee when it comes to ASP.NET. Ive only ever worked in PHP so I am completely baffled when I am looking at the code!
    I need to debug it so I need to understand it...

    I have attached the page code...

    I dont understand how the data on the page is pulled from the MSSQL database and is inserted in the page.
    If someone could explain to me how or point me in the right direction, I would be very grateful!

    Thanks!
    Attached Files Attached Files

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,111
    Thanks
    75
    Thanked 4,335 Times in 4,301 Posts
    ASP.NET does most of its work in "code behind" files.

    If the page you showed there has a name of, EXAMPLE ONLY, "mypage.aspx" then most of the coding will be in a file named either "mypage.aspx.cs" or "mypage.aspx.vb".

    There might well be several other pages "code behind" in support of that front page. For example (but not limited to), "mypage.aspx.designer.cs".

    The "placeholder" that you see there is just that: It will be replaced by contents generated in the other code.

    It would not be unusual to need to view 5 to 10 different files of code to understand how a single asp.net ".aspx" page is working. More common will be just the one or two added files.

    I really think you are tackling this from the wrong end. You probably should learn to build a couple of ASP.NET pages first, just so you see how it all fits together, before you try to debug and existing page.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    vorl (02-22-2012)

  • #3
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,717
    Thanks
    41
    Thanked 191 Times in 190 Posts
    To add on to what OldPedant said, an aspx page can call any number of C#/VB classes that may not be seen in the aspx.cs/aspx.vb file

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • Users who have thanked alykins for this post:

    vorl (02-22-2012)

  • #4
    Regular Coder
    Join Date
    Feb 2005
    Posts
    190
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    ASP.NET does most of its work in "code behind" files.

    If the page you showed there has a name of, EXAMPLE ONLY, "mypage.aspx" then most of the coding will be in a file named either "mypage.aspx.cs" or "mypage.aspx.vb".

    There might well be several other pages "code behind" in support of that front page. For example (but not limited to), "mypage.aspx.designer.cs".

    The "placeholder" that you see there is just that: It will be replaced by contents generated in the other code.

    It would not be unusual to need to view 5 to 10 different files of code to understand how a single asp.net ".aspx" page is working. More common will be just the one or two added files.

    I really think you are tackling this from the wrong end. You probably should learn to build a couple of ASP.NET pages first, just so you see how it all fits together, before you try to debug and existing page.
    Thanks Old Pedant for the advise! Would you happen to have any recommendations for learning?

    Thanks again!

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,111
    Thanks
    75
    Thanked 4,335 Times in 4,301 Posts
    Best way to start:

    Download the free "Web Developer Express" from http://msdn.microsoft.com/express

    Then from that same site, choose some of the many tutorials as appropriate to what you want to learn. After working through those basic ones, also look on http://www.asp.net for the tutorials there.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    vorl (02-22-2012)


  •  

    Posting Permissions

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