CST272 Final Project

"Insert Post Page"


  1. Create a web page "InsertPost.aspx" with the following elements:
  1. When the web page loads, the "Email" property contained in the query string passed from the "MemberHome.aspx" web page is stored in a private instance variable "Email" of type string
     
  2. An asp:SqlDataSource control that returns the all fields from the Posts table
     
    • InsertParameters need to be created for the EMail, Post and PostDate fields (however all references to the ID field in the SQL InsertCommand and InsertParameters should be removed)
    • (It is not necessary to include Update and Delete SQL statements and their related parameters, so these elements should be deleted from the ASP.NET code)

    InsertPost.png

  3. An asp:TextBox control where a user may type the text for a new post (see image above)
     
  4. An asp:RequiredFieldValidator control that ensures the user does not leave the Post TextBox blank; set the Display property for this control so that space for the validation message is allocated dynamically, that is only if validation fails
     
  5. A "Submit" asp:Button control that, when clicked, assigns the following values to the "Posts" SqlDataSource InsertParameters (see item b above)
     
    1. Email from the private instance variable "Email" (see item a above)
    2. Post from the user input TextBox described above (see item c above)
    3. PostDate from the computer system clock represented by the C# property DateTime.Now

    The Button click event handler then continues by inserting the new record into the "Posts" table after which control returns to the "MemberHome.aspx" web page passing it the private instance variable "Email" as a query string value

  6. A "Cancel" asp:Button control that when clicked returns to the "MemberHome.aspx" web page passing it the private instance variable "Email" as a query string value; set the CausesValidation property to "False" for this control so that it does not initiate validation processing for the "Post" TextBox