Hi frnds
i created like wizard and m shareing my code..
but here if i click on Register button form is not be submitted ?
so anyone tell me what i did wrong?
model///
public class Customer
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string Phone { get; set; }
public string Mobile { get; set; }
}
public class BasicDetails
{
[Required]
[Display(Name = "First Name")]
public string FirstName { get; set; }
[Required]
[Display(Name = "Last Name")]
public string LastName { get; set; }
}
public class AddressDetails
{
[Display(Name = "Street Address")]
public string Address { get; set; }
[Required]
[Display(Name = "City")]
public string City { get; set; }
}
public class ContactDetails
{
[Display(Name = "Home Phone")]
public string Phone { get; set; }
[Display(Name = "Mobile Phone")]
public string Mobile { get; set; }
}
controller///
public class WizardFormController : Controller
{
// GET: WizardForm
public ActionResult BasicDetails1()
{
return View();
}
[HttpPost]
public ActionResult BasicDetails1(Customer model)
{
if (ModelState.IsValid)
{
ViewBag.Name = model.FirstName;
ViewBag.Email = model.LastName;
}
return View(model);
}
[HttpPost]
public ActionResult BasicDetails1(BasicDetails data,
string prevBtn, string nextBtn)
{
if (nextBtn != null)
{
if (ModelState.IsValid)
{
}
}
return View();
}
}
view///
INPUT SEETING
DESIGNING
PUBLISH
Basic Details
@Html.LabelFor(m => m.FirstName)
@Html.TextBoxFor(m => m.FirstName)
@Html.ValidationMessageFor(m => m.FirstName)
@Html.LabelFor(m => m.LastName)
@Html.TextBoxFor(m => m.LastName)
@Html.ValidationMessageFor(m => m.LastName)
Address Details
@Html.LabelFor(m => m.Address)
@Html.TextBoxFor(m => m.Address)
@Html.ValidationMessageFor(m => m.Address)
@Html.LabelFor(m => m.City)
@Html.TextBoxFor(m => m.City)
@Html.ValidationMessageFor(m => m.City)
Contact Details
@Html.LabelFor(m => m.Phone)
@Html.TextBoxFor(m => m.Phone)
@Html.ValidationMessageFor(m => m.Phone)
@Html.LabelFor(m => m.Mobile)
@Html.TextBoxFor(m => m.Mobile)
@Html.ValidationMessageFor(m => m.Mobile)
@**@
Vinay SinghPosted Sep 7, 2016, 4:26 AM
Anjali KhanPosted Sep 7, 2016, 1:31 AM
Server Error in '/' Application.
The current request for action 'BasicDetails1' on controller type 'WizardFormController' is ambiguous between the following action methods:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.System.Web.Mvc.ActionResult BasicDetails1(WizardInMVC.Models.Customer) on type WizardInMVC.Controllers.WizardFormController
System.Web.Mvc.ActionResult BasicDetails1(WizardInMVC.Models.BasicDetails, System.String, System.String) on type WizardInMVC.Controllers.WizardFormController
Exception Details: System.Reflection.AmbiguousMatchException: The current request for action 'BasicDetails1' on controller type 'WizardFormController' is ambiguous between the following action methods:
System.Web.Mvc.ActionResult BasicDetails1(WizardInMVC.Models.Customer) on type WizardInMVC.Controllers.WizardFormController
System.Web.Mvc.ActionResult BasicDetails1(WizardInMVC.Models.BasicDetails, System.String, System.String) on type WizardInMVC.Controllers.WizardFormController
Nitin PanditPosted Sep 7, 2016, 1:15 AM