Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Dear sir I want to make registration form in asp.net (C#) and I wanna use html controls(input(text,password),radio,cheackbox,and submit button) and save it in sql database.
please give me complete code for undrstanding.
Posted 11-Dec-12 0:54am
Edited 11-Dec-12 1:00am
v2
Comments
Vani Kulkarni at 11-Dec-12 7:01am
   
What have you tried till now? Where are you stuck?
Milind_T at 11-Dec-12 7:09am
   
huh? Thats not how CP work Dear Sir.
You try your best, you stuck, others pour in their ideas.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Does google[^] broken at your place?
 
A simple search for your question gives 4,080,000 results, many of those threads will solve your question for sure.
 
Try something by your side first and then post your question if you get stuck somewhere around.
 
This is not at all appropriate.
  Permalink  
Comments
saurabh bhaedwaj at 12-Dec-12 1:39am
   
when I make it with the help of asp server control but now i'm tryin with html control but everything is complete but my data not saved .my checkbox is fine work. but data not saved in database. I attach my code to you.
 
""
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Drawing;
 
public partial class allrishteymaster : System.Web.UI.MasterPage
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ToString();
protected void Page_Load(object sender, EventArgs e)
{
//start making session
Session["email"] = Textmail;
Session["password"] = Textpassword;
Session["profilefor"] = profilefor;
Session["name"] = Textusername;
Session["gender"] = Radiomale;
Session["gender"] = Radiofemale;
Session["dd"] = dd;
Session["mm"] = mm;
Session["yy"] = yy;
Session["religion"] = religion;
Session["mothertongue"] = mothertongue;
Session["livingin"] = livingin;
//end making session
}
protected void regissub_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(constr );
SqlCommand cmd = new SqlCommand("insert into userregisteration" + "(uid,email,password,username,poprfilefor,gender,dob,religion,mothertongue,livingin,registrationdate)" + "values" + "(@uid,@email,@password,@username,@poprfilefor,@gender,@dob,@religion,@mothertongue,@livingin,@registrationdate)",con);
try
{
con.Open();
if (Checkbox1.Checked == true)
{
cmd.Parameters.Add(new SqlParameter("@email", Textmail));
cmd.Parameters.Add(new SqlParameter("@password", Textpassword));
cmd.Parameters.Add(new SqlParameter("@username", Textusername));
cmd.Parameters.Add(new SqlParameter("@poprfilefor", profilefor.SelectedIndex));
cmd.Parameters.Add(new SqlParameter("@gender", Radiomale.ToString()));
cmd.Parameters.Add(new SqlParameter("@gender", Radiofemale.ToString()));
cmd.Parameters.Add(new SqlParameter("@dob", dd.SelectedIndex + "-" + mm.SelectedIndex + "-" + yy.SelectedIndex));
cmd.Parameters.Add(new SqlParameter("@religion", religion.SelectedIndex));
cmd.Parameters.Add(new SqlParameter("@mothertongue", mothertongue.SelectedIndex));
cmd.Parameters.Add(new SqlParameter("@livingin", livingin.SelectedIndex));
Response.Redirect("RgistrationProfile2.aspx");
cmd.ExecuteNonQuery();

}
else
{
error.Text = "Check Privacy And T&C";
}
}
catch
{
con.Close();
}

}

}
""

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 11 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid