ASP.NET from Scratch : Lesson 2
videos

ASP.NET from Scratch: Lesson 2

Tutorial Details
  • Length : 42 minutes
  • Difficulty: Intermediate
This entry is part 2 of 10 in the ASP.NET from Scratch Session
« PreviousNext »

Continuing on from lesson one, Jeremy McPeak, author of Professional AJAX, and Beginning JavaScript: 4th Edition, will take things a step further as we delve deeper into working with the ASP.NET framework.


Screencast


Other Viewing Options


Add Comment

Discussion 55 Comments

  1. Shote says:

    Thank you.. keep them coming. Good work!

  2. TJM says:

    Don’t use asp:Panel as they usually render as divs – use asp:Placeholder for a cleaner option.

    • Author

      The Panel and PlaceHolder controls serve two different purposes – much like the Label and Literal controls.

      My use of Panel controls in EmailForm are correct – they contain markup and other controls. If I wanted to dynamically add the markup and controls to the page, the PlaceHolder would be the correct control to use.

      Correct use aside, I wanted a element. Why use a PlaceHolder if you’re going to contain everything in a element anyway?

      • Author

        Oops, that last paragraph should read:

        Correct use aside, I wanted a div element. Why use a PlaceHolder if you’re going to contain everything in a div element anyway?

      • TJM says:

        If that’s what you wanted to achieve then that’s great as you are in control of everything, but I’m not too keen on relying on a dynamically generated Id, especially one with and Id of “pnlSuccess”.

        For me a cleaner option is to use my own markup wherever possible with .NET – maybe just a habit I picked up since working with it since version 1.1 (when by default .NET rendered asp:Panels as table elements in non-IE “downgraded” browsers) and working in teams with roles that divide the presentation with the business logic.

        Lovely and methodical tutorial BTW!

  3. sasa says:

    Nice,
    thanks for lesson #2!

  4. TJM says:

    Don’t use asp:Panel as they usually render as divs – use asp:Placeholder for a cleaner option.

  5. Staggo says:

    Thanks for that!!!

  6. pelumi says:

    ‘am glad this is finally out

  7. Bruno says:

    Great.
    Finally some Asp.net articles;)

    Waiting for more.

  8. Nick says:

    So glad that the second lesson is finally here… Those are really helpful!!!
    When is the next one coming out?

  9. Maran says:

    I am .net developer. Its good have atleast few ASP.Net artticles. Thanks guys

  10. YrZ says:

    ASP sucks, learn php :)

    • Author

      I agree. ASP sucks. ASP.NET is much, much better, and in my opinion, it’s better than PHP (I used to be a PHP guy).

      • Zoran says:

        Could you please answer my question from bellow about the difference and how hard (long) is to learn ASP.NET if you are very good in PHP? I am using PHP for about year and a half and came to a conclusion that i can be very limited when it comes to making some complex stuff. I agree with you, some people are just too proudly ignorant that they don’t even know that ASP is different thing from ASP.NET :). It’s a fact that if you know more it’s better for you, so don’t be discouraged by bad comments, just keep up the good work, some people want to learn instead to fight what is better.
        @YrZ, try ASP.NET, use it for a while, then judge it… didn’t they teach you that prejudice is a bad thing? I love PHP a lot and did almost anything with it, but i am not married to it :D

      • Author

        I was typing out a short reply as you replied here =)

  11. Sergio says:

    around min 7 i think he said control like 10 times. still very helpful to understand controls.

  12. Zoran says:

    Could anybody, please tell me how hard is to learn ASP.NET if you are very good at PHP and what are the advantages of using ASP.NET over PHP? I am PHP lover, but i think that being familiar with more programming languages always is a good thing. Thank you for your video Jeremy, i am going to give it a try to learn at least the basics.

    • Author

      The two most challenging aspects of learning anything .NET, in my opinion, are:

      1. Getting familiar with with the classes in the Framework Class Library.
      2. Learning and getting comfortable with object oriented programming (if you don’t have any OOP experience).

      I can only speak from my experience, but the only problem I had in switching to ASP.NET with C# from PHP was finding decent online resources (I switched in 2003). That’s not much of a problem these days.

      The first part of this series covered some of the advantages. It’s by no means an exhaustive list. Something I didn’t put into that list is flexibility. One thing I hate about PHP is being completely dependent on the PHP installation in a shared-hosting environment. Unless you have a very generous host, you’re out of luck if you want to use extensions or third party components that require you to recompile PHP.

      With ASP.NET, using extensions or third party components is typically completely in your control. You simply add a reference to the components/extensions in your project, upload the DLLs, and you’re ready to roll. There are some exceptions to this; nothing requires a recompilation of .NET on the server, but some components do have to be installed on the web server in order to work correctly. MySQL’s Net Connector is one such component that has to be installed in order to take advantage of all the features.

      • Zoran says:

        Thank you for your answer, i am bit familiar with Visual Basic, Java and very much with OOP PHP, which i prefer over procedural way of coding. I think i will give it a shot to ASP.NET, not soon, but i downloaded both of your videos and will have a look when i have more free time. I won’t either have problem with databases, cause i have degree in Databases structures and never had problems switching from MySQL to something else, cause SQL as we know is same for each model. Also thanks for mentioning C#, that’s on my list too and keep up the good work… Variety and having multiple choices is always a good thing.

  13. Torsten says:

    I need new CI from Scratch Lessons and i have an Idee for the next from Scratch Lessons Java!!!

  14. Matt says:

    I was waiting for this for weeks. I haven’t watched it yet, but THANK YOU for putting this up.

  15. Chris says:

    So the code in btnSubmit_Click runs before Page_Load, correct? Or what’s the order there?

    Wow, I didn’t realize Server 2008 was free for students. What’s the difference between 2008 and 2008R2?

    • Matt says:

      2008R2, for the biggest improvement/hurdle, is that it is 64-bit only. It can run 32-bit apps through the WoW subsystem, but it is only 64-bit on the hardware level. It includes an updated IIS, ActiveDirectory enhancements, better virtualization support, etc.

      If you can run R2, do it instead of regular 2008. I think the only reason they have 2008 still up is for creating legacy applications designed for the 2008 platform (note, the student editions were created for studying, not for actual use).

    • Author

      Anything that causes a postback executes after the Page’s Load event. We haven’t gotten into postbacks for simplicity’s sake, but clicking the button causes a postback. So btnSubmit_Click executes after Page_Load.

  16. Ross says:

    Thanks a lot for the extremely helpful tutorial. I did C# ages ago, but have found that I forgot most of what I learned, and Im really eager to learn the ins and outs of the language again so that I can get serious with XNA, and also have a look at considering ASP.NET as my Web dev language of choice at work.

    Keep up the great work!

  17. Serge says:

    Thank you. Waiting for lesson 3 ;)

  18. I really like this. So how would you deploy it on your server. What files and or folders do you include.

    • Skunkie says:

      Simply Click “Build > Publish” and activate the “only files to run this apllication” button (select a local file path and see what happens).

      In detail

      You include:

      - the compiled .NET assemblies (the bin folder)
      - the web.config
      - static files (like .css, images etc.)
      - uncompiled aspx pages

      You do not include:

      - C# code files (including code-behind classes of aspx files)
      - Project and Solution files
      - the obj folder

      A free tool like CruiseControl.NET gives you more advanced publishing and maintanance option. You should check that for real-world apps.

  19. Vijay says:

    Excellent!!! Eagerly awaiting lesson 3.
    How different is C# with .net to VB with .net ? I have to work only in VB.net, but I am relate it to what I am working on.
    Thanks and keep up the generous good work !!!

  20. Miguel says:

    Awesome stuff, been waiting for this! Keep up the good work.

  21. Pete says:

    Really awsome series.

  22. Riya says:

    waiting for ASP.NET from Scratch: Lesson 3

  23. abdu says:

    Thank you , waiting for next .

  24. lawrence77 says:

    both the two lessons are fantastic….

    Now only finish watching… they are stunning for the beginners….

    Jeremy u rocks….. waiting for the further lessons…

  25. spartax says:

    thanks for the lesson… really helpful.

  26. tobar says:

    please ci or php videos. i hate .net and ms. asp is a stupid language.if i were you i learn java not asp ;)

    if you learn asp.net you will pay lots of dolars for hosting and sqlserver but linux is free and more secure.

  27. @Jeremy M.

    Great job on this tutorial. How were you able to center the email form. I’ve thoroughly examined your CSS codes and did not see any code for “centering”. I’ve tried the text-align: center, but this didn’t work for me. I’m running Windows XP Pro, Internet Explorer 8 and Firefox 3. In both IE and Firefox, the email form appears to the left of the browser.

    Thanks.

  28. CharlotteqK says:

    With the purpose to prevent the failures in some dissertation tips, that should be better to purchase the cool research referring to this topic at the dissertation writing service in Internet. It’s not so hard to reach the PhD coming that way.

  29. sasa says:

    waiting for ASP.NET from Scratch: Lesson 3

  30. Peter says:

    Awesome lesson. I have a little bit of experience in Java and it’s nice that it has some similarities.

  31. Mark Erasmus says:

    These tutorials are absolutely superb. Thanks Jeremy.

  32. Joshua says:

    So where is Lesson 3?

  33. 熱水器 says:

    I see the 2concern,I am very m happy to hear that you got your Supra fixed: I remember reading about some of your problem4x !.

  34. Jonathan says:

    This screencast is just crazy, I cite from min 6:30:

    “The intellicence tells us the Controls property is of type control collection. The collections in the framwork class library are pretty descriptive as what type of objects the collection holds. Science the word collection is prepended by the word control we can determine that the control collection class is a collection of control objects. Now remember in part one when i said that controls were classes, well all controls are subclasses of the Control class. Therefor all controls are instances of the Control class so the controls properties contains all the control objects that are contained within this form object…..”

    WOW, how can someone understand just by listening…

  35. saman says:

    how to download these lessons ? kindly guide .thanks

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.