Question: Create a web page InsertPost.aspx with the following elements: When the web page loads, the Email property contained in the query string passed from the
Create a web page "InsertPost.aspx" with the following elements:
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
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
An asp:TextBox control where a user may type the text for a new post see image above
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
A "Submit" asp:Button control that, when clicked, assigns the following values to the "Posts" SqlDataSource InsertParameters see item b above
Email from the private instance variable "Email" see item a above
Post from the user input TextBox described above see item c above
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
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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
