Hi, and thanks in advance.
I am currently creating a registration page that links to an access
database, I am using Visual Studio 2005 Express
I have created an Access datasource and bound it to the fields with in
my form, and when I click submit it inserts the data into the database,
I have got that far
My problem is that after insertion the page remains on the registration
page. I need it to redirect to a new page, I have tried calling
response.redirect("URL"), and that works too.... but it will only let
me do one or the other, when I add the response.redirect it redirects
to the page with out inserting the data
so far the relavant coding on the page looks like this:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub MemberRegistration_Selecting(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEv entArgs)
End Sub
Protected Sub CustomValidator1_ServerValidate(ByVal source As
Object, ByVal args As
System.Web.UI.WebControls.ServerValidateEventArgs)
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Register Now</title>
</head>
<body bgcolor="#B1B19B">
<form name="Registration" action="ConfirmRegistration.aspx" method=post
runat="server">
<asp:AccessDataSource ID="MemberRegistration" runat="server"
OnSelecting="MemberRegistration_Selecting"
DataFile="~/Database/Business System.mdb" InsertCommand="INSERT INTO
Members(EmailAddress, [Password], FirstName, LastName, DateOfBirth)
VALUES (@EmailAddress, @Password, @FirstName, @LastName, @DateOfBirth)"
SelectCommand="SELECT [FirstName], [LastName], [EmailAddress],
[DateOfBirth] FROM [Members] WHERE ([EmailAddress] = ?)">
<SelectParameters>
<asp:FormParameter FormField="EmailAddress" Name="?" />
</SelectParameters>
</asp:AccessDataSource>
<asp:FormView ID="FormView1" runat="server" DefaultMode="Insert"
DataSourceID="MemberRegistration" Height="122px">
<InsertItemTemplate>
<table>
<tr>
<td style="width: 131px">
Email Address:</td>
<td style="width: 100px">
<asp:TextBox ID="EmailAddress" runat="server"
Text='<%# Bind("EmailAddress") %>'></asp:TextBox></td>
<td style="width: 194px">
<asp:RequiredFieldValidator ID="EmailValidate"
runat="server" ControlToValidate="EmailAddress"
ErrorMessage="You must enter an email
address">*</asp:RequiredFieldValidator></td>
</tr>
<tr style="color: #000000">
<td style="width: 131px">
Password:</td>
<td style="width: 100px">
<asp:TextBox ID="Password" runat="server"
Text='<%# Bind("Password") %>'></asp:TextBox></td>
<td style="width: 194px">
<asp:RequiredFieldValidator ID="PSWDVAL"
runat="server" ControlToValidate="Password"
ErrorMessage="Please Supply
Password">*</asp:RequiredFieldValidator></td>
</tr>
<tr style="color: #000000">
<td style="width: 131px">
Confirm Password:</td>
<td style="width: 100px">
<asp:TextBox ID="PasswordConfirm"
runat="server"></asp:TextBox></td>
<td style="width: 194px">
<asp:CompareValidator ID="PSWDCOMP"
runat="server" ControlToCompare="PasswordConfirm"
ControlToValidate="Password"
ErrorMessage="Passwords must match"></asp:CompareValidator></td>
</tr>
<tr style="color: #000000">
<td style="width: 131px">
First Name:</td>
<td style="width: 100px">
<asp:TextBox ID="FirstName" runat="server"
Text='<%# Bind("FirstName") %>'></asp:TextBox></td>
<td style="width: 194px">
<asp:RequiredFieldValidator ID="FNVal"
runat="server" ControlToValidate="FirstName"
ErrorMessage="Please Enter First
Name">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td style="width: 131px">
Last Name:</td>
<td style="width: 100px">
<asp:TextBox ID="LastName" runat="server"
Text='<%# Bind("LastName") %>'></asp:TextBox></td>
<td style="width: 194px">
<asp:RequiredFieldValidator ID="LNVAL"
runat="server" ControlToValidate="LastName"
ErrorMessage="Please Enter Last
Name">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td style="width: 131px">
Date Of Birth:</td>
<td style="width: 100px">
<asp:TextBox ID="DateOfBirth" runat="server"
Text='<%# Bind("DateOfBirth") %>'></asp:TextBox></td>
<td style="width: 194px">
<asp:RequiredFieldValidator ID="DOBVAL"
runat="server" ControlToValidate="DateOfBirth"
ErrorMessage="Please Enter Date Of
Birth">*</asp:RequiredFieldValidator></td>
</tr>
</table>
<br />
<asp:Button ID="Insert" OnClick="Submit" runat="server"
Text="Submit" CausesValidation="true"/>
</InsertItemTemplate>