ASP.NET from Scratch : Lesson 1

ASP.NET from Scratch: Lesson 1

Nov 3rd in Screencasts by Jeremy McPeak

Nettuts+ is primarily a PHP haven; however, I'm sure we can all agree that there are many fantastic, and technically more powerful languages and frameworks at our disposal. Jeremy McPeak, author of Professional AJAX, and Beginning JavaScript: 4th Edition, will teach you how to build ASP.NET applications from scratch over the course of the next several video tutorials. Enjoy!

PG

Author: Jeremy McPeak

I started my development career on the client-side writing JavaScript and DHTML components in my spare time. In 2005, Nicholas C. Zakas asked me to join him in writing the first edition of Professional Ajax for Wiley Publishing. Since Professional Ajax, 1st Edition, I've been blessed to take part in other book projects: Professional Ajax 2nd Edition, and Beginning JavaScript 3rd and 4th editions.

Screencast

Other Viewing Options

Thank you, Screencast.com!

Screencast.com
...for providing the hosting for these video tutorials.


Related Posts

Check out some more great tutorials and articles that you might like

Enjoy this Post?

Your vote will help us grow this site and provide even more awesomeness

Plus Members

Source Files, Bonus Tutorials and
More for $9 a month for all TUTS+
sites in one subscription.

Join Now

User Comments

( ADD YOURS )
  1. PG

    Philo November 3rd

    Watching it now :) looks very detailed and well explained so far!

    ( Reply )
  2. PG

    Jeff Adams November 3rd

    I’m watching too – intersting for me as I came from a classic ASP background, i only want an understnading so fingers crossed!

    ( Reply )
  3. PG

    Konstantin November 3rd

    Wow.Really great! I’m starting thinking about moving from php to asp.net %)))

    ( Reply )
    1. PG

      enatom November 4th

      Whats the point of .ASP …. seriously? PHP is free, leaner, meaner and better… and its not from microsoft.

      ( Reply )
      1. PG

        bhollitek November 4th

        This isn’t .ASP. It’s ASP.NET and it also is FREE. Visual Web Developer and SQL Express are absolutely free downloads from Microsoft…

        http://www.microsoft.com/express/vwd/

      2. PG

        Chris Paul November 4th

        It’s just a tool. I used to feel the same way until I actually tried it. C# asp.net has some really cool features. Don’t knock it until you’ve built a large website with it.

      3. PG

        Bretticus November 4th

        As a user of both they couldn’t be any more different. PHP is a scripting language that is executed primarily via apache and an apache module. ASP.NET is intermediate language just like Java that runs on IIS on a non-free Windows server. You can use a myriad of languages for ASP.NET (c#, j#, even PHP!) Your code must be compiled to byte code (the reason you can choose languages) before deploying (I *think* there is a way to have it intermediately compiled from the code when requested similar to scripting languages.)

        For me it comes down to:

        Enterprise, huge project with out of ordinary requirements: .NET or Java (or Squeak even.)

        Small to Medium project that is easier to maintain and may not need uber performance: PHP, Perl, Python, Ruby.

      4. PG

        ANdy November 10th

        php Better??, men is your opinion, but i recomend you – STUDING First – before to talk, ASP.NET is really big and mature,organizated, etc etc, PHP is big, and excellent to, two diferent technologies, but ASP.NET is one thousend of thimes more robust and professional.

  4. PG

    barry November 3rd

    Meh, I ain’t learning no Microsoft junk. I’ll stick with PHP. Thanks for the tutorial though. It’ll help those interested in ASP.NET.

    ( Reply )
    1. PG

      Mike More November 3rd

      yes, Microsoft has a lot of junk (like Vista, Win 7).
      But, I must agree with Jeremy that “there are many fantastic, and technically more powerful languages and frameworks at our disposal” cause .Net is all that!

      no offense PHP lovers :) PHP is still cool..

      ( Reply )
      1. PG

        Hassan November 4th

        I am a PHP guy, and I haven’t coded with ASP.NET yet, but it’s far more powerful than PHP. (No to mention all benefits of .NET framework or it’s IDE). It’s not junk!

      2. PG

        Shaun November 4th

        Win 7 is junk all of a sudden?? Have you even used it?

      3. PG

        Joe November 4th

        it would be cooler if someone started up the RoR series again :P

    2. PG

      Lamin Barrow November 4th

      ASP.net is far far more superior than PHP and the Visaul Studio IDE environment is an absolute joy to work with. Did you know that it even has a complete well documented Jquery intellisence?

      ( Reply )
      1. PG

        Ab November 4th

        I am amazed that we can still today have that kind of approach. All languages and techniques evolved. Each language knew to draw the best from what exists and what was made. PHP is probably a good example, look at the great evolution between the version 4 and version 5. So I do not know why a language would be better than another?. Have you at least develop a big project in PHP, if so, can you tell us what do you blame PHP ? If your argument is “Visaul Studio IDE”, then I invite you to look around the PHP IDE’s and development framework. ASP. Net is a good product , and very powerful language, but I don’t think it’s better or worse than another language. Establish and manage a web project is not a question of language, because language is not an end in itself but a mean.

      2. PG

        Chris Paul November 4th

        I think you can even get PHP to work with visual studio. Search for VS.PHP.

        Visual Studio is my favorite IDE out there.

  5. PG

    Torsten November 3rd

    Hi, I’m waiting for the next CodeIgniter from scrach share when it can be expected?

    Sorry for my English, long live google language tools

    ( Reply )
    1. PG

      NetChaos November 3rd

      I’m also curious to know about it, the series got scrapped ?

      ( Reply )
      1. PG

        ricochet November 3rd

        I am also waiting on ‘CodeIgniter from Scratch’ – Day 8!

      2. PG

        Adam November 3rd

        Me too! I code 9-5 in ASP.net VB, but for my personal projects, I far prefer Codeigniter and it’s MVC framework over ASP.net’s offerings.

        I can’t wait for another CI tutorial. The web is relatively lacking in good CI tuts, and I would say Jefferey’s contributions so far have been probably THE best.

        This tutorial is definitely a good introduction to ASP.net, for sure. Nice job Jeremy!

      3. PG

        Jeff November 5th

        @Adam

        If you use Codeigniter for its MVC framework, you should give ASP.net MVC a try. It is pretty nice. Way better than webforms. And I dare say even better than codeinniter, but it might just be I am more familar with C# than php

    2. PG

      Kreatific November 3rd

      Yeah, same here.

      Have been wondering when the next installment of CI from scratch will appear. :)

      On a side note.

      Am I the only one that feels like things have been a little slow lately?

      ( Reply )
      1. PG

        Jeffrey Way November 4th

        It’ll come out sometime in November. I just need to get around to recording it. :)

  6. PG

    John November 3rd

    Great tutorial, just what I was looking for. I’m coming from PHP and was looking to get started with .NET. Thanks!

    @barry – Your loss. You’d be more valuable to companies knowing both.

    ( Reply )
    1. PG

      Caroline Schnapp November 3rd

      Barry would be more valuable to companies if he learned Ruby on Rails or Ruby on Merb.

      ASP.NET is on the decline. Depending on where you work in the world, it may even be considered dead.

      ( Reply )
      1. PG

        iFadey November 3rd

        I agree with you here.
        asp.net sucks!
        I also prefer to use PHP/CodeIgniter or RoR.

      2. PG

        Jeffrey Way November 3rd

        ASP.NET is not even close to being considered dead. That’s a ridiculous statement.

      3. PG

        Jeremy McPeak November 3rd

        ASP.NET certainly isn’t as widespread as other server-side technologies, but there’s nothing to indicate ASP.NET is on the decline (or dead).

        I think every developer should learn a variety of technologies and platforms to make themselves more valuable. While ASP.NET’s market share in web-centric business makes ASP.NET experience not as valuable as Python or RoR in that particular space, .NET experience is sought after in other markets… small to medium business being one such area.

        All in all, it’s disingenuous to discount ASP.NET as declining and/or dead when it’s very much alive, well, and supported.

      4. PG

        Shane November 4th

        You can argue until the cows come home about which framework/language/operating system is ‘best’. If there was a wordpress plugin that cut out comments that argued such a point, there wouldn’t be many comments on some posts!!!

        I completely agree with Jeffrey about ASP.NET; to say that it’s dead couldn’t be further from the truth. I have earned a good salary from ASP.NET for the last five years or so, and I’m excited about its future.

        Many of the tutorials on the web aren’t aimed at ASP.NET, because historically, ASP.NET is a Microsoft product, and the development environment and so on wasn’t free. That has all changed now with the Express editions of Visual Studio and so on, so ASP.NET is open to all.

        The simple fact is that Microsoft IS a massive player in the web, and so learning ASP.NET is a good move. Just don’t be blinkered to other technologies.

        Have an open mind. And I’m afraid some Microsoft-haters are as ignorant as anybody.

      5. PG

        lawrence77 November 5th

        Well said Shane….

        ASP.NET also rocks…

      6. PG

        Jason November 8th

        I’d add to Shanes comment that with server virtualization in the latest OS the cost of windows hosting will go down. One advantage PHP had was that Apache hosting was way cheaper compared to Windows. The other advantage was that PHP was essentially free. With free alternatives now in the ASP.Net market and cheaper hosting all that is poised to change. Throw in Visual Studios IDE and PHP and RoR will have some competition.

    2. PG

      yassir November 3rd

      if it is dead why is microsoft spending hundreds of millions on it ?

      ( Reply )
      1. PG

        Caroline Schnapp November 3rd

        Because they can afford it.

      2. PG

        Mosselman November 4th

        That does not only sound somewhat moronic, it is too.

        You really think that a company as big and experienced as Microsofto would spends hundreds of millions on something that is ‘dead’?

        Companies don’t become big by blindly pumping money into things that aren’t worth it.

      3. PG

        Mosselman November 4th

        Clarification added (+/-) 4 hours later:
        In case you were wondering, Microsofto is the Japanese branch of Microsoft.

  7. PG

    Alexander November 3rd

    its not MSIL anymore, its CIL – Common Intermediate Language.

    But great tut anyway.

    ( Reply )
    1. PG

      Jeremy McPeak November 3rd

      Old habits die hard. I’ll work on rectifying that one =)

      ( Reply )
  8. PG

    Jared November 3rd

    Why no coldfusion tuts?

    ( Reply )
    1. PG

      elkaz November 4th

      coldfusion = huge failure.

      ( Reply )
      1. PG

        chronomantic November 4th

        I finally got the opportunity to try out coldfusion for a school project and I really enjoy the tag based syntax :)

        it was a very easy language to pick up.

      2. PG

        Matt November 8th

        elkaz, Coldfusion and ASP.NET developers are paid more by project than those who develop in PHP/Ruby/Django.

        Why? Well, anymore they’re harder to find. Shame. Companies want them because ASP.NET and Coldfusion are stable, proven technologies. PHP, as great as it is, isn’t reliable enough for many companies.

  9. PG

    Bobby November 3rd

    Good intro to ASP and the IDE, you might want to add limited commercial hosting options as negative as the audience at this site would definitely consider that.

    ( Reply )
    1. PG

      Jeremy McPeak November 3rd

      Howdy, Bobby.

      Hosting was briefly touched on at the end of the negatives. It’s not so much that availability is limited, but that Windows hosting is more expensive than *nix hosting.

      Of course, what’s cheap and what’s expensive is relative to each individual person. I pay less for hosting on Windows Server 2008 than I paid for PHP/MySQL hosting ten years ago, but it certainly is higher than the dirt cheap *nix hosting you can find today.

      ( Reply )
      1. PG

        Sean November 3rd

        Although some Windows-based hosting providers are more expensive than others, I’ve used MochaHost (mochahost.com) in the past and found them to be pretty good. $3.99 USD per month is a pretty good deal. Obviously it depends on the kind of site you’ll be hosting, but for your average ASP.NET app (blog, forum, small business/e-commerce site) it definitely works well.

      2. PG

        Dejan November 5th

        I am using http://www.arvixe.com/ for hosting 6 asp.net sites with unlimited number of SQL2008 databases and it costs me $72 annually ($6 per month). I am very satisfied, they are reliable and tech support is very qualified, each time I talk to them I am pleasantly surprised talking to someone who does not sound like a robot that does copy/paste from tech manual.
        If you give it a second thought, running host company takes a lot of money and software costs are just a fractional part of total costs, so there is actually no reason why MS hosting should be more expensive than PHP hosting.

      3. PG

        Jeff November 5th

        As far a hosting is concerned I actually find that the quality hosts out there usually provide both platforms, and for very close to the same dollar value.

    2. PG

      Jason November 8th

      I touched on this in another comment thread. With Windows Servers getting virtualization your going to see the cost of hosting come down. Look at providers like DiscountASP.net as an example. The cost of hosting on the Windows side is coming way down now. And if you want to venture into the wal-mart of hosting you can check out Godaddy’s asp.net hosting which is the same price as their linux hosting.

      ( Reply )
    3. PG

      Joe November 15th

      Hey Sean, you mentioned you used mochahost, could you please tell me the best way to upload/synchronize your website to mochahost?

      I used the built-in Copy Website in VS2008, but it’s not really good. I tried FileZilla but it doesn’t automatically detect changes.

      Any suggestions?

      Thanks

      ( Reply )
  10. PG

    Mario Awad November 3rd

    “and technically more powerful”… be careful from the PHP fanatics :-)

    ( Reply )
  11. PG

    John November 3rd

    Can a future segment include how to store that form data in a database? That’d be extremely helpful. :)

    ( Reply )
    1. PG

      Jeremy McPeak November 3rd

      Howdy, John.

      Yes, we’ll get into storing and retrieving data from a database in a few lessons. It will not be in the next, but perhaps the third or fourth.

      ( Reply )
  12. PG

    Ashraf Ali November 3rd

    “Use Libraries writen in other languages”

    Written*

    ( Reply )
  13. PG

    Nuno November 3rd

    Great tutorial, for some reason the itunes download does not finish. Please fix that. An error occurs. Thanks

    ( Reply )
  14. PG

    Derrick November 3rd

    Wow! Great. I am starting to learn asp.net and have had an intorduction but this is not just a scratch but a big bite.

    Thanks.

    Derrick

    ( Reply )
  15. PG

    Prashant November 3rd

    More asp.net tutorials Please !!

    ( Reply )
  16. PG

    Dan November 3rd

    Will have to give this a watch. We are developing an app that will utilize .NET web services but will also rely heavily on jQuery for Ajax.

    Bringing up a question (as I’m a bit of a newbie..): Is it normal to have an Ajax-powered site developed primarily with web services and a lot of javascript?

    I ask because we’d only really be using .NET to talk to an MS SQL box and for the web services – I feel like I’m missing something.

    Thanks for any and all answers/input – and thanks for the .NET vid series!

    ( Reply )
    1. PG

      Jeff November 5th

      The good news for you here is that asp.net and visual studio play very nicely with jquery.

      That being said if the web services you are interacting with are part of the main functionality of your site, and not something like displaying some rss feed as a small widget or the likes. Then I would tend to do most the comunication with the web service on the serverside and not with javascript.

      ( Reply )
    2. PG

      Matt November 8th

      Take a look at ASP.NET AJAX sometime. It’s very handy and fits well into the existing platform.

      http://www.asp.net/ajax/

      ( Reply )
      1. PG

        Matt November 8th

        Mean to put in there, but I forgot, ASP.NET AJAX includes JQuery.

    3. PG

      Jason November 8th

      download the beta of vs2010, it’s integration with jQuery is very very nice.

      ( Reply )
  17. PG

    iFadey November 3rd

    Hmm…
    Good for ASP.NET fans but I want CodeIgniter’s next screencast please

    ( Reply )
    1. PG

      Matt November 8th

      Why did you even reply?

      ( Reply )
  18. PG

    Erik November 3rd

    This was great,
    Awesome job — I love .net more than anything. Compiled Code ftw…

    ( Reply )
  19. PG

    IgnacioRV November 3rd

    Good screencast, well explained and simple!

    Two of my classmates from university love .NET and are trying to make me work with it (till today I remain loyal to PHP and Ruby, so they aren’t doing a good job promoting the plataform xD).

    One of the reasons for what I don’t like .NET very much is because it seems a little improved version of JSP (I had to do some works for university in JSP and I hated it so much… I like java, but JSP is horrible).

    However, I’ll give a chance to this series and learn the basics about .NET, hope you start with the MVC framework soon.

    ( Reply )
    1. PG

      Jeff November 5th

      ASP.net MVC is awesome. I have always enjoyed .net but always kind of cringed with webforms. I know Microsoft did it because like the author said, at the time Microsoft’s audience was windows developers, and they wanted a design experience like winforms. But programing for the web is so different, I always hated all that bloated state information passed between my pages.

      Now, I can say goodbye to it forever, thanks to ASP.net MVC

      ( Reply )
      1. PG

        Jason November 8th

        and MVC2 is even better. :)

  20. PG

    GaVrA November 3rd

    Very nice tutorial. I really dont like asp.net, but like John said the more you know – you are more valuable to companies. :)

    ( Reply )
  21. PG

    Leo November 3rd

    I can’t believe how much people hate microsoft , the way i see it .net framework it is a powerful one and plus gives you the oportunity to move to desktop programming fairly easy once you learn asp.net either on c# or vb i’m gonna be following this screencasts really close
    Thanks nettuts

    ( Reply )
  22. PG

    Eric B. November 3rd

    Wasn’t .NET just trown together my MS just to have something to compete with Sun? Instead, they could have helped out with Java, and we could have ended up with something really awesome.

    ( Reply )
  23. PG

    demogar November 3rd

    Oh God. It hurts my eyes!! ASP.NET + Internet Explorer = mmmh :)

    Anyway, I enjoyed the screencast and its better if we learn it than ignore it, but I really prefer PHP and Python than ASP.NET :D

    ( Reply )
    1. PG

      Kevin November 4th

      Starting to get into Python lately myself. I love it!

      ( Reply )
    2. PG

      Matt November 8th

      And that’s why major companies will ignore your resume ;)

      Learn JSP, ASP.NET, and ColdFusion. If you are serious about web development, it is vital to know these power 3.

      PHP is great for your home blog, but Corporation X doesn’t want to hear about it.

      ( Reply )
  24. PG

    Chris November 3rd

    Visual Studio is a great IDE. I love intellisense!

    I just started C# asp.net about a year ago. Why is there a CssClass property but no CssId property? Have you have found an acceptable solution for this? I hate referencing css IDs like ‘#ctl00_container’ or something like that in my stylesheet.

    Also, I’d like to see some tutorials about IIS, stored procedures, how to do common PHP/Apache things in asp.net (mod_rewrite?).

    Thanks!

    ( Reply )
    1. PG

      Andy November 3rd

      Use the control’s “ID” property, you don’t need to look up the ClientID.

      ( Reply )
    2. PG

      Jeremy McPeak November 3rd

      When we dig a little deeper into WebForms, we’ll find some drawbacks to WebForms. The generated element’s ID attribute is one of those drawbacks.

      It’s not as cut and dry as Andy’s post implies. When you start dealing with naming containers (such as Master Pages, repeaters, etc), you begin to lose control over the generated element’s ID attribute (and HTML for that matter).

      That’s a gripe many people, including myself, have with WebForms.

      ( Reply )
      1. PG

        Jeff November 5th

        enter ASP.net MVC. OK, I will try not to say it again. But check it out.

      2. PG

        Jason November 8th

        yep, I agree with Jeff. MVC2 is the future.

    3. PG

      Kel November 4th

      Solved in .NET 4.0. look up the new ClientIdMode control property. Setting this property to legacy delivers what we have now (quite annoying). Setting it to static lets you shoulder responsibility for client IDs.

      ( Reply )
  25. PG

    Andy November 3rd

    Hmm…understandably a lot of ASP.NET hate right off the bat seeing as how a lot of the NETTUTS readership is from the MAMP camp. As a switch hitter (Mac + Win) myself, I love the .NET framework just as much as PHP.

    I hope that more advanced .NET tutorials are written in the future. This seems to be a great start to a very nice tutorial series.

    ( Reply )
  26. PG

    Jaysone November 3rd

    Hi Guys, thanks again for an awesome screencast..was just wondering..what happened to the wordpress for designers series? Hope this comment of mine is not ignored..

    ( Reply )
  27. PG

    Eric Boyer November 4th

    I’d really like to see these tutorials shape into the .NET MVC and steer clear of the Web Forms approach. Will deff. be more valuable to me, and anyone else working with it professionally.

    Do you think you will do this after the introductory videos?

    ( Reply )
    1. PG

      Jeremy McPeak November 4th

      We’ll definitely get into ASP.NET MVC. I wanted to start with it, actually, but I felt that WebForms needed coverage first since its been around since .NET’s release.

      ( Reply )
      1. PG

        Bretticus November 4th

        Excellent. From what I’ve seen, the ASP.NET MVC guys have done a tremendous job!

  28. PG

    Alan November 4th

    WOW great :-) . Been waiting for this quite some time :-)

    ( Reply )
  29. PG

    Gaurav November 4th

    I am a UI designer and the company I work at uses ASP.NET for developing web apps. The thing I hate about ASP.NET is that it is very very rigid and works only in its own framework. I am referring to the AJAX Toolkit and the ASP components like server side combo box etc. When it is rendered in browser, all the design gets screwed up and I have to again sit and rectify it because when the controls are converted into html, it adds some padding or margin etc. And ofcourse the over all development is expensive in comparison to php.

    PHP is easily embeddable in html and there are no server side controls so it plays very nice with js or css or html. And the overall development is very cheap.

    ASP.NET is very powerful and a RAD technology. But PHP is cheaper and very good for CRUD apps. I think I will stick to PHP for now.

    ( Reply )
    1. PG

      Jeremy McPeak November 4th

      It sounds like your gripes are with WebForms, and we’ll be looking at WebForms’ downsides as we dig deeper into that programming model. One very important concept to remember is, like the relationship between squares and rectangles, all WebForms applications are ASP.NET applications, but not all ASP.NET applications are WebForms applications.

      When we start looking at .NET 4.0 features, and especially when we move to MVC, we’ll have much more control over the HTML markup, and we’ll see a return to embedding code in our markup.

      As for the cost, I mentioned in another comment that development cost is cheap. You can develop an ASP.NET application without spending an extra dime all while using robust (and free!) tools.

      ( Reply )
      1. PG

        Gaurav Chandra November 4th

        If I need to send an email from a contact form, php is certainly the way to go and it is fast to develop than asp.net.

        Development of asp.net will be cheaper for large scale apps like a banking system or ERP.

        For php coding and deployment I use :

        1) Aptana IDE – Free (coding php and excellent debugging capabilities)
        2) MySQL – Free (enterprise level dbms comparable to ms sql server)
        3) Apache – Free
        4) Ubuntu Linux Server Edition – Free

        Total Cost = NIL one time

        For ASP.net coding and deployment I use:

        1) Web Developer – Free
        2) SQL Server 2008 standard – $5,999.00
        3) IIS – Free
        4) Windows Server 2008 Standard – $1029

        Total Cost = $7028 one time

        And don’t forget that ASP.Net developers are more expensive than PHP developers atleast in some parts of the world.

        Now if the company is paying for the cost, no problem. But if an individual has to pay for the cost, a big no no.

        Even then I would say ASP.Net is a good technology but should be competitively priced.

      2. PG

        Jeff November 5th

        @Gaury

        There is no reason your asp.net setup couldn’t be

        1)web Develper – free
        2)mySQL or SQL Express – free
        3)IIS-free
        4)Windows Web Server – $400 (if you really needing to buy your liicense here)

        I mean, you can’t compare the to saying asp.net is more expensive because you have to a $6,000 database server. You can still use mySQL or one of microsofts free alternatives.

      3. PG

        Jason November 8th

        @Gaurav

        Your comparison makes no sense and does nothing but show your prejudice against MS.

        First off, most companies (especially where price is an issue) isn’t going to be doing their own hosting and if your suggesting otherwise to them then you are doing them a disservice – unless your building a local web application that is only being used by the employees of the company and they will never be accessing it from outside the building.

        If they are going to be accessing it from outside the building then your better off using a hosted solution at a company like discountasp.net or heaven forbid godaddy if your going super discount rate.

        As for developing the application, as Jeff pointed out, there’s a cheap route for that as well.

        Finally, corporate clients (I can tell you from experience) assign a value to dollars spent. You go in there and start spouting off on free this and cheap that and a lowball price and you’ll get passed over. Get a good middle of the road price and they’ll consider you. Come in too high and they’ll look and unless you have a stellar resume and are a big time design firm you’ll get tossed as well. Some companies immediately toss out the outliers on either side and only look at the middle of the bell curve.

        Lastly, (I know I already said finally) if your dealing with a company whose sole consideration for choosing you is price you don’t want to deal with them anyway. TRUST ME!

  30. PG

    Joe MacDonald November 4th

    Fantastic, despite being a PHP lover I’ve always wanted to venture into .NET just because of the power it can hold.

    Looks forward to the follow ups and the MVC approach.

    ( Reply )
  31. PG

    eren yagdiran November 4th

    how could i notify the user that the email is sent through smtp ?

    ( Reply )
    1. PG

      Jeremy McPeak November 4th

      You can add another MailAddress object to the MailMessage object’s To collection like this:

      email.To.Add(new MailAddress(txtEmail.Text, txtName.Text));

      Or you could use the CC and Bcc properties like this:

      email.CC.Add(new MailAddress(txtEmail.Text, txtName.Text));
      email.Bcc.Add(new MailAddress(txtEmail.Text, txtName.Text));

      ( Reply )
  32. PG

    Parker November 4th

    ASP.NET is by far more powerful and faster than PHP. Also you enjoy the IDE of ASP.NET and its existing controls.

    ( Reply )
    1. PG

      OOP November 4th

      for people like you:
      .net is a framework = can be compare with ROR, CAKE, CI and …
      PHP is a language = can be compare with C#, VB and …

      ( Reply )
      1. PG

        Jeff November 5th

        actually you are a little wrong. PHP is both a language and a framework.

        ROR and CAKE, CI are more equivalent to ASP.net Webforms and MVC.

  33. PG

    Charlie November 4th

    Great tutorial!

    Just a quick note for those who want to try this with GMail!

    Make sure to enable SSL before sending the email.

    SmtpClient server = new SmtpClient();
    server.EnableSsl = true;
    server.Send(email);

    Otherwise it will fail! :)

    ( Reply )
  34. good input

    ( Reply )
  35. PG

    Kevin November 4th

    I’ve yet to face a situation PHP can’t handle but I will watch this for general knowledge in case I have to debug apps built with asp.net.

    As for PHP v ASP, there are many arguments for using either or, but for me, I’ll always promote OpenSource products as it is what I believe in.

    ( Reply )
    1. PG

      Jeremy McPeak November 4th

      .NET is shared source. The source for the CLR has been available for years; it’s why the Mono project exists today. When Microsoft released the 2008 versions of Visual Studio, they released even more source code. It’s not exactly open source, but its there to view, read, copy, and contribute to in the form of bug submissions.

      ( Reply )
      1. PG

        Kevin November 4th

        I see. I’ll have to look more into it.

        However, I still think the cost factor is an issue. Learning in a LAMP environment is practically free (depending on IDE you use) whereas moving to .net (even just to learn) would be costly.

      2. PG

        Jeremy McPeak November 4th

        Cost really isn’t an issue unless your computer doesn’t come with a Windows OS license. Everything else is free. You wouldn’t have access to the Professional version of Visual Studio (if you’re a non-student) unless you paid for it, but Visual Web Developer Express is more than sufficient for learning and writing ASP.NET apps.

      3. PG

        Jeff November 5th

        I really hate the cost argument. Also, if you are new or a student. Chack out BizSpark, WebSpark, etc. All programs to get everything you need free to get your application built and launched.

        Even hosting with dedicated servers.

  36. PG

    Luke November 4th

    I’ve been hoping you guys would do something with .net it’s not my preference, but it’s what’s used here at work…so thank you!

    ( Reply )
  37. PG

    Matthew November 4th

    What screencast software did you use for this one?

    ( Reply )
  38. PG

    DemoGeek November 4th

    I love ASP.NET for its own capabilities. If it’s not for the limited and expensive hosting choices (very expensive to give some things a try) I would certainly stick with ASP.NET.

    PHP hosting is dirt cheap with a whole array of choices. Even though there is a learning curve the hosting choices itself burns my hours to figure things out the PHP way.

    I wish Microsoft provides some help on the .NET hosting side.

    In the mean time do you know of any good and cheap web hosts for ASP.NET stack?

    ( Reply )
    1. PG

      Jeremy McPeak November 4th

      Sean mentioned http://www.mochahost.com in an earlier comment. They look to offer some great features for $3 – $6 a month. I need to do more research on them, but I’m considering switching mochahost. I’m currently with http://www.dailyrazor.com using the .NET Fusion plan ($17/month)

      ( Reply )
      1. PG

        Jeremy McPeak November 4th

        I should amend my previous statement with this: I love my host. DailyRazor has excellent customer service and support, and they’ve gone out of their way to ensure I’m happy. I’m sure they groan every time they see my name attached to a ticket or request, but I am very well taken care of there. It’ll take that same service and support, same or better features, and a much lower price in order to get me to switch. I cannot recommend them enough.

        Their cheapest is $6/month, and they’re always running some kind of promotion for new signups.

    2. PG

      matt November 4th

      Another popular asp.net host that is pretty inexpensive (at least when I did my research a couple months ago)…

      http://www.arvixe.com/asp_net_web_hosting

      …they still seem pretty comparative to your standard linux hosting price.

      ( Reply )
    3. PG

      Jason November 8th

      check out discountasp.net

      ( Reply )
  39. PG

    tom wornall November 4th

    https://www.dreamspark.com/default.aspx
    if you have a student email

    ( Reply )
    1. PG

      DemoGeek November 4th

      Tom – that’s for the software but I was more looking for cheap and better web hosts with no long term commitments etc.

      ( Reply )
    2. PG

      Jeremy McPeak November 4th

      That is a good point, and I’ll make sure it makes it into the next lesson. If you have a student email address, or can verify that you are a student, you can get Visual Studio 2008 Professional for free, as well as Windows Server 2008, Expression Studio, and a variety of other software with the Dreamspark program.

      ( Reply )
      1. PG

        Matt November 8th

        You can also get a full, non-evaluation copy of 2010 Beta 2 now.

        Great for developing new ASP.NET applications using the new DLR with .NET 4.0.

  40. PG

    Kyle November 4th

    Any speed difference between C# and VB?

    ( Reply )
    1. PG

      Ben November 4th

      No, there is not any speed difference between the two languages.

      ( Reply )
    2. PG

      Joe November 4th

      http://tr.im/E8JH

      yay internet…

      ( Reply )
    3. PG

      OOP November 4th

      Same speed: 0 to suck under 5 minutes…

      ( Reply )
      1. PG

        Jason November 8th

        aren’t you clever.

    4. PG

      Skunkie November 12th

      No speed difference on runtime. They both are precompiled into bytecode, so the same code is executed at request time.

      There is a difference in development speed and convienience though. C# is the better-featured language. Automatic properties like the following example

      public float Price {get; set;}

      are only available in C#. Those come in very handy when you do ORM for example.

      In VB you would have to declare a private property “price” as well as public getter and setter methods to get the same thing.

      It also looks like C# will get more attention by Microsoft’s development team in the future.

      The C# syntax also is more similar to PHP than VB.

      So when you have to make a decision about which language to choose when you dive into .NET – LEARN C#

      Hope i could help u.

      ( Reply )
  41. PG

    Amal November 4th

    Hey nettuts team, your video tutorials have been really great for the past and this one tops it all. I took an 8 week course in college about asp.net with c# and didnt learn anything. I learned from this beginner tutorial more about asp.net.

    For those who keep saying asp.net is dead or on the decline or it sucks, I just think they are ignorant about it and does not want to change their way of thinking or adapt to a different platform.

    Thank you nettuts team and Jeremy. Really great job and looking forward for the following videos. :)

    ( Reply )
  42. PG

    Mike November 4th

    So glad to finally see some .net content here. I know a lot of people have to use PHP due to the cost but if you really want to there are resources out there. Dreamspark has already been mentioned. There is also http://www.microsoft.com/bizspark/

    ( Reply )
  43. PG

    Tom November 4th

    “WebForms Came About becuase of Visual Basic Developers”

    Did anybody else catch the typo?

    ( Reply )
    1. PG

      Kel November 4th

      A couple guys on my team just completed a 250,000 line metallurgical charge optimization application that will save our company over 1 million Euros per year — they used a VB Win Forms application to do it.

      ( Reply )
  44. PG

    dappy November 4th

    I’d love to see more .NET tutorials. I work in a mixed server environment (.Net for half the sites, PHP for the other half) and I’d love to get better at .NET

    Most of the the .Net stuff I find googling is way, way over my head.

    ( Reply )
  45. PG

    Jaap Rood November 4th

    The preference for PHP didn’t fall out of the air, it is a better platform for web apps. I have to do stuff with .NET at work though, so this video series will help me out understand it all a bit better, since I come arround loads of weird and illogical stuff in ASP.

    What happened to the code igniter series? I love that series

    ( Reply )
    1. PG

      Jeremy McPeak November 4th

      PHP’s popularity is largely due to its simplicity and ease of use. Anyone can read a few tutorials and write a database-driven website with PHP. It is an extremely easy language to learn and use, and there’s no doubt about its superiority to other platforms in the 1990s and early 2000s… especially classic ASP.

      Better is relative to the developer. “Use what you want to use” is my philosophy.

      ( Reply )
      1. PG

        Bretticus November 4th

        I can’t help but comment again. I use PHP pretty much exclusively these days (I dabble in ASP.NET, Classic ASP –pain– and even python.)

        It’s not so much which is better, but what one is right for the job. Again, 90% of the time, I am building contact submission forms or similar simple Web controls. I feel like .NET or Java are just overkill for things like that. More importantly, 90% of my customers are hosted on Apache. However, if I have to build something larger (XML-RPC. multiple applications, etc.) .NET or Java is the way to go.

  46. PG

    Matt November 4th

    Fantastic screencast. I’ve been working with asp.net for many years. I also work with PHP – Each has their place. For corporate world (ie, where you get paid), the bulk of the time it will be asp.net that will get used.

    ( Reply )
  47. PG

    Norm November 4th

    Great job!
    Hope to see more asp.net tutorials, maybe some covering issues on migrating from localhost to live host, express DB versus SQL Server?

    Thanks,

    ( Reply )
  48. PG

    Ben November 4th

    Does the difference in the cost of web hosting really matter?

    The Adobe Creative Suite isn’t cheap, but most web designers and developers don’t seem to have a problem acquiring it.

    The difference between the cost of linux hosting and windows hosting seems marginal compared to the cost of a lot of the other tools a developer/designer uses.

    ( Reply )
    1. PG

      Gaurav Chandra November 4th

      Adobe Creative Suite is not for web development. It is a tool. Don’t buy Adobe Creative Suite for php. In fact you don’t even need it for web development. Use a free IDE like Aptana which has more or less same features as Visual Studio or a notepad.

      And how can you even say web hosting cost does not matter????

      ( Reply )
      1. PG

        Ben November 4th

        I think you’re missing my point.

        I completely understand where Adobe CS is and is not needed–and I never said it’s needed for PHP.

        I just think it’s funny how so many developers/designers use the latest version top-notch professional tools, regardless of cost (probably because it’s pirated), yet purchase the absolute cheapest web host they can find.

    2. PG

      DemoGeek November 5th

      Ben – I think you are missing the point too. There are many different ways a developer can get exposed to those fancy tools if not can just stick with some of the best open-source alternatives.

      But when it comes to web hosting it’s $$$ that we have to shed and there is no other choice. Having some cheap, alternate ASP.NET hosting support would help the many developers cook things up and give the concept a try before shedding $$$$ into long-term commitments. I don’t know about you but I’ve burnt $$$ for nothing with an ASP.NET web host. It would have really helped if I had the choice of web hosts similar to the open-source platform.

      ( Reply )
      1. PG

        Ben November 5th

        Not to be rude, but how am I missing the point? It was my original comment.

        Squabbling over the cost of a cheap linux host or a cheap windows host is like squabbling over the difference in cost of varying Netflix subscriptions. Only a web host is a bit more important since it’s a business expense, and can directly contribute to your livelihood (as a professional developer/designer).

        Don’t get me wrong. I’m all for PHP and Open Source if that’s what works best for you (I’m still relatively new to ASP.NET myself). So if you’re a productive PHP developer, and prefer working with that technology over ASP.NET, then great. Save a few bucks every month on your hosting bill.

        However I’ve discovered that I can earn a lot more money in the ASP.NET world than I ever could with PHP, so that added cost is an investment I would gladly make.

        On a side note, for those who just want to learn ASP.NET you can run IIS on your own windows box for free.

    3. PG

      Jeremy McPeak November 6th

      Whether or not it matters depends on the individual. It mattered to me when I first looked for a web host ten years ago, and it still does to some extent today. Hosting cost isn’t going to determine what technology I use (where it might have back then), but I still shop around to find the best features and reliability for the best price.

      ( Reply )
      1. PG

        Ben November 6th

        Thanks Jeremy. I really appreciate this tutorial. It was great, and I can’t wait for the others.

  49. PG

    Moksha November 4th

    wow asp.net tutorial thanks

    please add more asp.net MVC

    ( Reply )
  50. PG

    Bram November 4th

    This tutorial couldn’t come on a better moment for me!
    I was looking for a good starter tutorial, for some reason there isn’t a good how to start tutorial on the ASP.net site.
    You did also a awesome job to explain everything very clear and understandable.

    ( Reply )
  51. PG

    Yoyo November 4th

    Great tutorial! I can’t wait for the next part.

    ( Reply )
  52. PG

    Mike November 4th

    In the words of Dick Vitale “Awesome with a capital A baby”. Keepem coming, I will be here for each and every one.

    ( Reply )
  53. PG

    vija November 4th

    Excellent I love it.

    ( Reply )
  54. PG

    Brian Temecula November 5th

    I’ve tried to learn ASP.NET in the past, and this video reminded me why it never happened. I think what throws me off from the start is that I am used to hand coding everything, so even though it would seem easier to some people, a GUI really makes things more difficult for me. I started in the video, and actually made it about 15 minutes, but I’d have to start from the beginning and watch this video a few times to get it.

    ( Reply )
    1. PG

      Jeremy McPeak November 5th

      You don’t have to use the drag-n-drop approach; I don’t for web apps. This first lesson only showed the RAD capability. After the first control was added to the page via drag-n-drop, the rest of the app was hand coded.

      The RAD capability from Microsoft’s Visual Studio is there, but you don’t have to use it if you don’t want to.

      ( Reply )
  55. PG

    kaise November 5th

    anybody no wer i can get the rest of the turorials please

    ( Reply )
  56. PG

    Aaron November 5th

    Finally, something on ASP.NET. I use the framework at work and C#. It’s nice to see a tutorial on this stuff finally. I look forward seeing more in the future. Thanks for the post!

    …and to whoever said ASP.NET was dead, seriously? I’m not a hardcore ASP.NET fan, but it’s definitely not dead.

    ( Reply )
  57. PG

    Eli Perelman November 5th

    Jeremy, I have your book, and it was really great using it to jump start me into Ajax. Thanks!

    ( Reply )
  58. PG

    alphafer November 5th

    I am a PHP advocate but my work requires me to do some .Net stuff. I refussed to learn it for a long time. This tutorial didn’t change my opinion about .Net but there is not doubt that it will help me to do my job and better discuss my PHP is better! opinion.

    Thank you

    ( Reply )
  59. PG

    David Moreen November 5th

    It took a while but nettuts is now doing ASP.NET tutorials. Interesting.

    ( Reply )
  60. PG

    dave November 5th

    Great tut. I do alot of asp.net and SharePoint work at my 9-5 job. The only thing I dont like it that asp.net controls often render lots of nested tables and extra html code.

    ( Reply )
  61. PG

    Kikas November 5th

    Hello Jeremy,

    I really like your video, just finished right now, very simple and easy to follow, been waiting for ASP.NET tutorials, thanks for this, i will continue watching :)

    Cheers

    ( Reply )
  62. PG

    Bleyder November 6th

    Great video for begginers!! Thanks

    ( Reply )
  63. PG

    Maddie November 6th

    Thanks so much, can’t wait to see the rest of the series!

    ( Reply )
  64. PG

    Jeremy McPeak November 6th

    Thanks for the kind words, all!

    ( Reply )
  65. PG

    Martin November 6th

    I see more jobs advertised for ASP.NET developers than PHP. Unfortunately I have not tried it yet, because I develop mainly on a Mac. If I were to study another system for 1 year, before applying for web developer jobs, would it be more valuable to learn ASP.NET or Ruby on Rails? I have some intermediate PHP skills already.

    ( Reply )
    1. PG

      Ben November 6th

      Martin,

      I would highly recommend learning ASP.NET (C#). Just like you, most of the jobs I see advertised want an ASP.NET developer rather than a PHP developer.

      If you’re interested in RoR or PHP, I would continue to learn those as well. It will only make you more knowledgeable. Besides, who knows what the industry standard for server side development will be 5 years from now?

      But right now I’ve found that it’s a lot easier to find a good web development job if you have marketable skills in ASP.NET than any of the others.

      ( Reply )
  66. PG

    T November 6th

    One of the best tutorials for ASP.NET i have seen. excellent explanation of controls, cant wait for the rest……. Keep up the great work!

    ( Reply )
  67. PG

    Prashant November 7th

    Help

    The SMTP server requires a secure connection or the client was not authenticated

    ( Reply )
    1. PG

      Jeremy McPeak November 7th

      Set the EnableSsl property of the SMTPClient object to true, like this:

      server.EnableSsl = true;

      ( Reply )
      1. PG

        Prashant November 8th

        I added this

        SmtpClient server = new SmtpClient();
        server.EnableSsl = true;
        server.Send(email);

        but still i get error

        The SMTP server requires a secure connection or the client was not authenticated

      2. PG

        Jeremy McPeak November 10th

        The problem can be one of two things, then. First, the information you provided in the web.config file is incorrect.

        Second, whoever controls your SMTP server can limit who can use that SMTP server to send emails. Some ISPs limit SMTP access if, and only if, the computer you’re on is on their network.

  68. PG

    Matt November 8th

    Speaking of ASP.NET, Microsoft is releasing an Open Source CMS sometime this week named “Orchard”. Should be fun to play with.

    It’s Sunday the 8th where I am.

    ( Reply )
  69. PG

    JGambaX November 8th

    Awesome, Thanks And I Hope To See Many More Of This Serie.

    ( Reply )
  70. PG

    Drazen Mokic November 8th

    This is a very good tutorial, repect.

    Guys dont forget that you should use the right tool for the job, not the other way.

    I love PHP but if i would have a project where ASP comes better i would use ASP.

    ( Reply )
    1. PG

      Matt November 8th

      This.

      ( Reply )
      1. PG

        HELLO2 November 8th

        what ?

  71. PG

    Natrium November 9th

    I watched the first 10 minutes and it looks promising!
    Well explained, everything is well visible.
    I’ll watch the rest of the tutorial later today!

    ( Reply )
  72. PG

    Anders Lassen November 9th

    As a newcomer to object-oriented programming and C#, this is a very interesting tutorial. Well explained and relevant information. Thank you.

    ( Reply )
  73. PG

    Tim November 9th

    I just tried to download it for OSX. Why no OSX support? PHP works no matter what development environment you have.

    ( Reply )
    1. PG

      Jeremy McPeak November 10th

      .NET is primarily a Windows-only technology. Look into the Mono project if you want to run .NET code on other platforms.

      ( Reply )
  74. PG

    Steve November 9th

    I installed everything how you describe (using a mac running VMWare with Windows 7). And I get this error:

    “Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to ‘\\vmware-host\Shared Folders\Documents\Visual Studio 2008\Projects\WebApplication1\WebApplication1′.

    Any ideas? There’s nothing in the file except the default HTML.

    ( Reply )
    1. PG

      Jeremy McPeak November 10th

      It sounds like there’s an error in the web.config file. Does the error message provide any other details?

      ( Reply )
  75. PG

    John November 9th

    I switched from asp.net to php about a year ago. Why? Because of Wordpress. If i want to get good at WP, i had to know the php basics.

    And in doing so, i realized how dead fast it is to do very simple things. I don’t need to add weird code at the top of every web page like i do with asp.net.

    I really like the simplicity of php when i do simple scripting.

    But if i need to interface with a database, or do paginate database results with sorting, in-place editing, etc, i think asp.net is the better choice. It has built-in features that take care of this stuff automatically and are quite simple. I’ve read tutorials on doing this stuff with php, and it went WAY over my head.

    So i guess it all comes down to your needs.

    ( Reply )
  76. PG

    Daniel November 10th

    hi everybody,

    I got this error message when I try to send the email:

    Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: The value of the property ‘port’ cannot be parsed. The error is: is not a valid value for Int32.
    Could somebody give me a help?

    ( Reply )
    1. PG

      Jeremy McPeak November 10th

      Did you open web.config and add information for your SMTP server? That error message is saying the value of the port attribute isn’t an integer. So either it’s empty or there are non-integer characters as the attribute’s value.

      ( Reply )
  77. PG

    Emilio November 10th

    Great stuff!, really usefull. Cant wait to see the other screencasts =)

    Thanks!

    ( Reply )
  78. PG

    sean November 11th

    Nice tutorial! Easy to understand :)
    Waiting Lesson 2

    Thanks.

    ( Reply )
  79. PG

    Nick November 11th

    Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!
    I’ve been asking for asp.net tutorials forever now and glad to see that envato listens to readers requests!

    ( Reply )
  80. PG

    michael jackson November 15th

    Waiting Lesson 2

    ( Reply )
  81. PG

    codex73 November 16th

    when is new lesson coming out?

    ( Reply )
  82. PG

    sebastienr November 17th

    Waiting for Lesson2 too !

    ( Reply )
  83. PG

    sasa November 17th

    Next lesson, please.

    ( Reply )
  1. Arrow
    Gravatar

    Your Name
    November 17th