Hi friends,
I need a registration page where in the first page some fields will be entered by the user and when he clicks a second form appear in that form the first filed values are shown in the form and other filed are empty, user needs to fill that form and when he click register button all data will be inserted to the database.
I need a registration page like the URL given http://www.paisalive.com/
Its urgent please send me the code.
Thanks
Loading
Satyapriya NayakPosted Sep 10, 2011, 3:30 AM
Here is your solution.Run the attachment.
FirstForm.aspx code
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="FirstForm.aspx.vb" Inherits="FirstForm" %>
FirstForm.aspx.vb code
Imports System.Data.SqlClient
Imports System.Data
Partial Class FirstForm
Inherits System.Web.UI.Page
Dim strConnString As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ToString()
Dim con As New SqlConnection(strConnString)
Dim sqlda As SqlDataAdapter
Dim com As SqlCommand
Dim ds As DataSet
Dim str As String
Dim url As String
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
url = "SecondForm.aspx?name=" & TextBox1.Text & "&email=" & TextBox2.Text & "&mobileno=" & TextBox3.Text & " &country=" & DropDownList1.SelectedItem.Text
Response.Redirect(url)
End Sub
End Class
SecondForm.aspx code
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="SecondForm.aspx.vb" Inherits="SecondForm" %>
SecondForm.aspx.vb code
Imports System.Data.SqlClient
Imports System.Data
Partial Class SecondForm
Inherits System.Web.UI.Page
Dim strConnString As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ToString()
Dim con As New SqlConnection(strConnString)
Dim sqlda As SqlDataAdapter
Dim com As SqlCommand
Dim ds As DataSet
Dim str As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox4.Text = Request.QueryString("name")
TextBox1.Text = Request.QueryString("email")
TextBox6.Text = Request.QueryString("mobileno")
DropDownList1.Items.Add(Request.QueryString("country"))
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
con.Open()
Session("fname") = TextBox4.Text
Session("lname") = TextBox5.Text
str = "insert into employee values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & Session("fname") & "','" & Session("lname") & "','" & TextBox6.Text & "','" & DropDownList1.SelectedValue & "')"
com = New SqlCommand(str, con)
com.ExecuteNonQuery()
con.Close()
Response.Redirect("sucess.aspx")
End Sub
End Class
Success.aspx code
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="sucess.aspx.vb" Inherits="sucess" %>
Success.aspx.vb code
Partial Class sucess
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label1.Text = "Welcome:" + "
" + Session("fname") + Session("lname") + "
"End Sub
End Class
Thanks
If this post helps you mark it as answer