Sams Teach Yourself ASP.NET in 21 Days, Second Edition
By Chris Payne
Table of Contents
Day 4.  Using ASP.NET Objects with C# and VB.NET

This workshop will help reinforce the concepts covered in today's lesson. Answers can be found in Appendix A.



What are static members?


Will the following code snippet work?

 <html><body>    Hi there!    <%       Response.Redirect("page2.aspx")    %> </body></html> 

What language is the following code snippet written in?

 Response.Write("Hello there!") 



Create an ASP.NET page in C# that acts as a secure login page. Allow the user to enter a username and password in a text box. If they match a string you specify, redirect the user to a "success" page. Otherwise, display an error. If the user is valid, save her username in a Session variable.


Write the success page in VB.NET. Display a personalized Welcome message using the Load event of the Page object and a Label control. Also inform the user of the current time and his Session ID. Check the IsPostback property of the Page object to ensure that this message is only displayed the first time he arrives at the page. Provide a button for him to log out, with a confirmation message.


    Sams Teach Yourself ASP. NET in 21 Days
    Sams Teach Yourself ASP.NET in 21 Days (2nd Edition)
    ISBN: 0672324458
    EAN: 2147483647
    Year: 2003
    Pages: 307
    Authors: Chris Payne © 2008-2017.
    If you may any questions please contact us: