Creating regiatration page in MVC [Resolved]

Posted by Varun66 under ASP.NET MVC on 8/26/2013 | Points: 10 | Views : 1595 | Status : [Member] | Replies : 6
Hi,

Can you please provide me an example regarding creation of registration page in MVC?

Thanks in advance....
Varun66




Responses

Posted by: Kmandapalli on: 8/26/2013 [Member] Silver | Points: 50

Up
0
Down

Resolved
Hi,

I am attaching a zip file which contains an example.
You can download it and practice....

Mark as answerif satisfied....

Regards,
Shree M.

Kavya Shree Mandapalli

Varun66, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kmandapalli on: 8/26/2013 [Member] Silver | Points: 50

Up
0
Down

Resolved
Hi,

Here is the code..

Step 1:
Open your controller and write an action method as below..
public ActionResult Register()
{
return View();
}


Step 2:
Right-click on modes folder and add a model (Details.cs) and declare the following properties..
public class Details()
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailID { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public string ConfirmPassword { get; set; }
public long ContactNo { get; set; }
}

public class Login
{
public string UserID { get; set; }
public string Password { get; set; }
}


Step 3:
Create a view for the action method Register (Register.cshtml).
Check the create a strongly- typed checkbox and add the details model.
Open the view and write the following code..
@model JobSiteSeekers.Models.Details
@{
ViewBag.Title = "Register";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
function handleWizardNext() {
if (document.getElementById('ButtonNext').name == 'Step2') {

document.getElementById('ButtonNext').name = '';
document.getElementById('ButtonNext').disabled = 'disabled';
document.getElementById('ButtonPrevious').name = 'Step1';

document.getElementById('ButtonPrevious').disabled = '';

document.getElementById('Step1').style.display = 'none';
document.getElementById('Step2').style.display = '';

}
}

function handleWizardPrevious() {
if (document.getElementById('ButtonPrevious').name == 'Step1') {

document.getElementById('ButtonNext').name = 'Step2';
document.getElementById('ButtonPrevious').name = '';
document.getElementById('ButtonNext').disabled = '';
document.getElementById('ButtonPrevious').disabled = 'disabled';

document.getElementById('Step2').style.display = 'none';
document.getElementById('Step1').style.display = '';
}

else if (document.getElementById('ButtonPrevious').name == 'Step2') {

document.getElementById('ButtonNext').name = '';

document.getElementById('ButtonPrevious').name = 'Step1';
document.getElementById('Step2').style.display = '';
}
}
function submitForm() {
document.fmReg.submit();
}

</script>
@using (Html.BeginForm("Register", "Home", FormMethod.Post, new { id = "fmReg", name = "fmReg" }))
{
<div align="center" style="background-color: Black; color: Orange; font-weight: bold; width:83%;
font-size: x-large">
Sign Up here!
</div>

<div align="center">
@*<asp:Label ID="Label2" runat="server" Text="Employees/ Employers! Register here!!"
SkinID="FormHeading"></asp:Label>*@
@Html.Label("Label2", "Employees/ Employers! Register here!!")
</div>
<br />
<p>
Registration is a two step process:</p>
<br />
<ol>
<li>Choose a user name and password</li><li>Choose whether you would like to register
as an "Employee" or "Employer".</li></ol>
<p>
Once you register with us you can access respective secured areas for posting resumes
or posting jobs.</p>
<div align="center" id="wizard">
<span id="Step1">
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td align="right">
First name:
</td>
<td>
<input id="TextFirstName" name="FirstName" type="text" />
</td>
</tr>
<tr>
<td align="right">
Last name:
</td>
<td>
<input id="TextLastName" name="LastName" type="text" />
</td>
</tr>
</table>
</span><span id="Step2" style="display: none">
<table border="1" style="background-color: #ffffee">
<tr>
<td align="right" style="font-weight: bold; font-size: medium;">
@Html.LabelFor(model => model.FirstName) :
</td>
<td>
@Html.TextBoxFor(model => model.FirstName)
</td>
</tr>
<tr>
<td align="right" style="font-weight: bold; font-size: medium;">
@Html.LabelFor(model => model.LastName) :
</td>
<td>
@Html.TextBoxFor(model => model.LastName)
</td>
</tr>
<tr>
<td align="right" style="font-weight: bold; font-size: medium;">
@Html.LabelFor(model => model.EmailID)
</td>
<td>
@Html.TextBoxFor(model => model.EmailID)
</td>
</tr>
<tr>
<td align="right" style="font-weight: bold; font-size: medium;">
@Html.LabelFor(model => model.UserName) :
</td>
<td>
@Html.TextBoxFor(model => model.UserName)
</td>
</tr>
<tr>
<td align="right" style="font-weight: bold; font-size: medium;&qu

Kavya Shree Mandapalli

Varun66, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kmandapalli on: 8/26/2013 [Member] Silver | Points: 50

Up
0
Down

Resolved
Hi,

Mark as answer if ur satisfied withe reply...

Regards,
Shree M.

Kavya Shree Mandapalli

Varun66, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/26/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Step by step procedure to develop Resistration page in MVC
http://20fingers2brains.blogspot.in/2013/01/sample-register-form-in-aspnet-mvc3.html
http://www.c-sharpcorner.com/UploadFile/cd3310/create-registration-form-using-Asp-Net-mvc-tools/

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Varun66, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/26/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi Varun,

I haven't found any attachment with the above reply..
Did you able to find the Shree's Zip file?


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Varun66, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kmandapalli on: 8/26/2013 [Member] Silver | Points: 25

Up
0
Down
Hi varun,

I am trying to attach the zip file but it is exceeding the limit .
So, i will attach it in code snippet, you can download it from there..

Regards,
Shree M.

Kavya Shree Mandapalli

Varun66, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response