Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:



<!-- containe end -->



<!-- container start -->








<!-- container end -->


<!-- Registration start -->
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)


Registration


<!-- form start -->
<form class="register-form" id="userReg" method="post">



@Html.LabelFor(m => m.Name, new { @class = "col-md-4 text-right mobile-leftalign", })


@Html.TextBoxFor(m => m.Name, new { @class = "col-md-4 text-left mobile-leftalig" })



@*

 



@Html.RadioButton("Usertype", "Company",
new { id = "IsCompany" }) Company


@Html.RadioButton("Usertype", "Indivisual",
new { id = "IsIndivisual" }) Indivisual



*@


@*

@Html.LabelFor(m => m.CompanyName, new { @class = "col-md-4 text-right mobile-leftalign", })




<select id="basic" class="selectpicker show-tick form-control">
<option value="0">Please Select</option>
<option value="Andhra">Alchemy</option>
<option value="Karnataka">IBM</option>
<option value="Kerala">HCL</option>
<option value="Tamil Nadu">TCS</option>
<option value="Odisha">KPMG</option>
<option value="Delhi">FIROFOX</option>
<option value="Up">EY</option>
<option value="Tamil Nadu">DELL</option>
</select>



*@


@Html.LabelFor(m => m.Phone, new { @class = "col-md-4 text-right mobile-leftalign", })


@Html.TextBoxFor(m => m.Phone, new { @class = "col-md-4 text-left mobile-leftalig" })



@Html.LabelFor(m => m.Email, new { @class = "col-md-4 text-right mobile-leftalign", })


@Html.TextBoxFor(m => m.Email, new { @class = "col-md-4 text-left mobile-leftalig" })



@Html.LabelFor(m => m.Profession, new { @class = "col-md-4 text-right mobile-leftalign", })




<select id="basic" class="selectpicker show-tick form-control">
<option value="0">Please Select</option>
<option value="Software Engineer">Software Engineer</option>
<option value="Software Developer">Software Developer</option>
<option value="Business Analysist">Business Analysist</option>
<option value="Trainee">Trainee</option>
<option value="Team Lead">Team Lead</option>
<option value="Project Manager">Project Manager</option>

</select>





@Html.LabelFor(m => m.MainSkill, new { @class = "col-md-4 text-right mobile-leftalign", })



<select id="basic" class="selectpicker show-tick form-control">
<option value="0">Please Select</option>
<option value="Asp.Net">Asp.Net</option>
<option value="C#">C#</option>
<option value="BOOTSTRAP">BOOTSTRAP</option>
<option value="JAVA SCRIPT">JAVA SCRIPT</option>
<option value="JQUERY">JQUERY</option>
<option value="SQL">SQL</option>

</select>





@Html.LabelFor(m => m.MainSkill, new { @class = "col-md-4 text-right mobile-leftalign", })



<select id="basic" class="selectpicker show-tick form-control">
<option value="0">Please Select</option>
<option value="Asp.Net">Asp.Net</option>
<option value="C#">C#</option>
<option value="BOOTSTRAP">BOOTSTRAP</option>
<option value="JAVA SCRIPT">JAVA SCRIPT</option>
<option value="JQUERY">JQUERY</option>
<option value="SQL">SQL</option>

</select>





@Html.LabelFor(m => m.Education, new { @class = "col-md-4 text-right mobile-leftalign", })



<select id="basic" class="selectpicker show-tick form-control">
<option value="0">Please Select</option>
<option value="Asp.Net">B.TECH</option>
<option value="C#">MBA</option>
<option value="BOOTSTRAP">MCA</option>
<option value="JAVA SCRIPT">BSC</option>
<option value="JQUERY">BCA</option>
<option value="SQL">MSC</option>

</select>






</form>


}
Posted
Comments
Ehsan Sajjad 18-Sep-15 3:48am    
Can you show your model class as well?
Member 11970398 18-Sep-15 6:32am    
public class UserRegistration
{
[Required(ErrorMessage = "Please Enter Name")]
[Display(Name = "Name")]
public string Name { get; set; }
[Required(ErrorMessage = "Please Enter Email Address")]
[Display(Name = "Email")]
[RegularExpression(@"^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$",
ErrorMessage = "Please Enter Correct Email Address")]
public string Email { get; set; }
[Required(ErrorMessage = "Please Enter Mobile No")]
[Display(Name = "Mobile")]
[StringLength(10, ErrorMessage = "The Mobile must contains 10 characters", MinimumLength = 10)]
public string Phone { get; set; }
public string Profession { get; set; }
public string MainSkill { get; set; }
public string Education { get; set; }
public string Stream { get; set; }
public DateTime Age { get; set; }
// public string Usertype { get; set; }
public string Address { get; set; }
// public string CompanyName { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Pincode { get; set; }
public string country { get; set; }
}

1 solution

C#
public class UserRegistration
  {
      [Required(ErrorMessage = "Please Enter Name")]
      [Display(Name = "Name")]
      public string Name { get; set; }
      [Required(ErrorMessage = "Please Enter Email Address")]
      [Display(Name = "Email")]
      [RegularExpression(@"^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$",
      ErrorMessage = "Please Enter Correct Email Address")]
      public string Email { get; set; }
      [Required(ErrorMessage = "Please Enter Mobile No")]
      [Display(Name = "Mobile")]
      [StringLength(10, ErrorMessage = "The Mobile must contains 10 characters", MinimumLength = 10)]
      public string Phone { get; set; }
      public string Profession { get; set; }
      public string MainSkill { get; set; }
      public string Education { get; set; }
      public string Stream { get; set; }
      public DateTime Age { get; set; }
      //  public string Usertype { get; set; }
      public string Address { get; set; }
      // public string CompanyName { get; set; }
      public string City { get; set; }
      public string State { get; set; }
      public string Pincode { get; set; }
      public string country { get; set; }
  }
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900