I am learning ASP.NET 4 and i am trying to a form which the user enter details into text boxes and drop downs and then presses enter to complete form and the details go into a database in Oracle. What i would like to do is when the enter button is pressed i would like it to clear the form of anything entered and then show a message to say something like 'Thank you for your details'.
The form is working and records all the information to the database so all i need help with is clearing the form after button pressed and then to show message.
I'm not sure what code i need to show you so please ask if you do or anything else if i have not explained myself enough.
Thanks
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="StyleSheet.css" rel="stylesheet" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="navigationB">
<ul id="nav">
<li><a href="Net3.aspx">Home</a></li>
<li><a href="news.aspx">News</a></li>
<li><a href="Contact.aspx">Contact</a></li>
<li><a href="About.aspx">About</a></li>
<li><a href="Default.aspx">Finance Help</a></li>
</ul>
</div>
<div id="dform">
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<h3 id="head3"><u>Please Enter Your Details:</u></h3>
Enter Your Name:
<asp:TextBox ID="nameB" runat="server"></asp:TextBox>* <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="You Must Provide Your Name" ControlToValidate="nameB"></asp:RequiredFieldValidator>
<br />
Enter Your Age:
<asp:TextBox ID="ageB" runat="server"></asp:TextBox>* <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ageB" ErrorMessage="You Must Enter Your Age"></asp:RequiredFieldValidator> <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="Age Must be Between 1-99" ControlToValidate="ageB" MaximumValue="99" MinimumValue="1" SetFocusOnError="True"></asp:RangeValidator>
<br />
<br />
Male:
<asp:CheckBox ID="cbMale" runat="server" groupname="sexB" />
<br />
Female:
<asp:CheckBox ID="cbFemale" runat="server" groupname="sexB"/>
<br />
<br />
<h3 id="header3"><u>Select Hospital Department</u></h3>
<asp:DropDownList ID="DDList" runat="server" Width="201px">
</asp:DropDownList>*
<asp:DropDownList ID="DDList2" runat="server" Width="145px">
</asp:DropDownList>*
<br />
<asp:RequiredFieldValidator runat="server" ErrorMessage="You Must Select One Option" ControlToValidate="DDList"></asp:RequiredFieldValidator>
  ; <asp:RequiredFieldValidator ID="RequiredFieldValidator" runat="server" ErrorMessage="You Must Select One Option" ControlToValidate="DDList2"></asp:RequiredFieldValidator>
<br />
<br />
<asp:Button ID="ButtonEnt" runat="server" Text="Enter"/> <asp:Button id="btnReset" onclick="btnReset_Click" runat="server" Text="Reset Form"></asp:Button>
<br />
<br />
<asp:Label ID="requiredField" runat="server" Text="(*) Denotes Required Field"></asp:Label>
<br />
</div>
</form>
</body>
</html>
My Function..
Imports Microsoft.VisualBasic
Imports Oracle.DataAccess.Client
Imports System.Data
Public Class sqlFunc
Public Shared Function tableData() As DataSet
Dim oraConnect As New OracleConnection
oraConnect.ConnectionString = ConfigurationManager.ConnectionStrings("smart_dev").ConnectionString
Dim oraCommand As New OracleCommand
oraCommand.Connection = oraConnect
oraCommand.CommandType = Data.CommandType.Text
Dim lsSQL As String = ""
lsSQL = "SELECT code, description FROM ref_code WHERE domain = 'SPECIALTY'"
oraCommand.CommandText = lsSQL
Dim da As New OracleDataAdapter(oraCommand)
Dim ds As New DataSet
da.Fill(ds)
Return ds
End Function
Public Shared Function tableData2() As DataSet
Dim oraConnect As New OracleConnection
oraConnect.ConnectionString = ConfigurationManager.ConnectionStrings("smart_dev").ConnectionString
Dim oraCommand As New OracleCommand
oraCommand.Connection = oraConnect
oraCommand.CommandType = Data.CommandType.Text
Dim lsSQL As String = ""
lsSQL = "SELECT code, description FROM ref_code WHERE domain = 'CATEGORY'"
oraCommand.CommandText = lsSQL
Dim da As New OracleDataAdapter(oraCommand)
Dim ds As New DataSet
da.Fill(ds)
Return ds
End Function
Public Shared Function dataInsertTable(ByVal sName As String, ByVal iAge As Integer, ByVal sSelect As String, ByVal dList As String, ByVal dList2 As String) As String
Dim answer As String = "Y"
Dim conSmart As New OracleConnection
conSmart.ConnectionString = ConfigurationManager.ConnectionStrings("smart_dev").ConnectionString
Dim oraCommand As New OracleCommand
oraCommand.CommandType = Data.CommandType.Text
oraCommand.Connection = conSmart
Dim lsSQL2 As String = ""
lsSQL2 = "INSERT INTO TEST_JC VALUES ('" & sName & "','" & iAge & "','" & sSelect & "','" & dList & "','" & dList2 & "' , sysdate )"
oraCommand.CommandText = lsSQL2
Try
conSmart.Open()
oraCommand.ExecuteNonQuery()
conSmart.Close()
Catch ex As Exception
answer = ex.Message
End Try
Return answer
End Function
End Class