McNelis.biz

Various Rumblings From A Dink

McNelis.biz header image 2

Intro to Web Forms

January 9th, 2007 · No Comments

Being new to .Net, C#, ASP, ect., I wasn’t sure how to make use of forms and their data. Don’t get me wrong, I know the basics of how it would work, but not the specifics for the environment I am trying to get acquainted with. So I went looking for the obvious, a ‘Hello World’ type of example to start me down my path of webby goodness.

That is when I stumbled upon this MSDN article explaining how to use web forms…it was a primer for the most part. Fortunately for me, and hopefully for others looking to get started with C# (or VB) in web development it provided a single example attacked in a few different ways. It also went over the main points to the different approaches and finally got into a technology that until this time was completely new to me, Web Forms…not to be confused with a basic Form tag. To quote the author, Jeff Prosise:

Web Forms have the potential to change Web programming by introducing a new programming model built around server-side controls—a model in which controls render their own UIs by generating HTML to return to clients and firing events that are handled by server-side scripts. Since all the action takes place on the Web server, virtually any browser can run a Web Forms app. And thanks to Visual Studio .NET, building a Web Forms app is a lot like using Visual Basic: just drop a control onto a form then write an event handler. This article describes the Web Forms programming model, how it fits with ASP .NET, and introduces DataGrid, TextBox, and other classes in the .NET Framework class library.

I won’t get into the nuts and bolts yet, because I’m really only about halfway through reading the article (it is lengthy), but I can tell you this much, web forms are looking like they will make my side project go a lot smoother and easier once I master the basic architecture and how the different elements interact with the code.

Just to give you an update on my current progress with my project, I’ve got the user control tables created and all their relationships finished up. I started looking into the web forms stuff so that I could start working on a user registration page and started working on that last night…I ended up doing more reading and researching than actual coding though. Tonight, after I play some Madden 07 on the Wii, I’ll hopefully get my first piece of .Net interacting with a web page and MS SQL, maybe even calling a stored procedure.

I do need to request two bits of advice, if anyone out there is comfortable commenting on these questions. First, would it be better to handle password encryption on the code side or the db side of an application. I can see arguments for both, and if no one responds will probably lay out those arguments in another post.

Second, I plan to send users an email with a validation key that they need to click in order to complete registration (and to verify they own the email address they are registering from). What methods would you employ to generate this key? Would you generate the key separately for each user and store the key in your user table, then keep a date field for when the key was redeemed, then base some future interaction on whether or not the date field is null or not?

Tags: .Net · C# · General

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment