locked
how to save datausing mvc RRS feed

  • Question

  • User2088646281 posted

    i want to make A REGISTRATION FORM that have two drodowns name email password city(dropdown),state(drodown) and country(dropdown) value into database table...how can i do that using mvc

    Saturday, April 9, 2011 12:11 AM

Answers

  • User197322208 posted

    want to perform operation edit,details and delete..please reply how can i do that...send me any demo example link...because i am totally fresher in mvc

    For this basic question please follow basic tutorials like MVC Music Store/NerdDinner at  http://www.asp.net/mvc/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 15, 2011 4:43 AM

All replies

  • User197322208 posted

    For this basic question please follow basic tutorials like MVC Music Store/NerdDinner at  http://www.asp.net/mvc/

    Saturday, April 9, 2011 3:29 AM
  • User-1210061641 posted
    Hi Vikas,
    If you want to bind the selected values(city, state and coutry) to the properties of RegisterModel, the dropdwonlist name must be the same as correspondent properties. For your suitation, you can retrieve city, state and country values from database and store them to the ViewData, in the Register view, use the follow line to generate dropdownlist:
    @Html.Dropdownlist("City", new SelectList(ViewData["cities"] as List<string>),"select one city")
    Or you can define an Address class which contains City, State and Country as its properties. And then override editorFor template for Address type. In the Register View pass the values which are used to generate dropdownlist through the additionalViewData parameter of EditorFor Helper. For how to override editer template, you can refer to here:
     
    Hope this helpful,
    Forest Cheng
     
    Monday, April 11, 2011 2:29 AM
  • User2088646281 posted

    Hi..

    thanks for reply..for me situation is that state dropdown should be bind according to coutry id(selected coutry) and ciy drop down will be bind according to selected state(sate id)..and then i want to save name email password city(dropdown),state(drodown) and country(dropdown) value into database table,and want to perform operation edit,details and delete..please reply how can i do that...send me any demo example link...because i am totally fresher in mvc

    Friday, April 15, 2011 1:24 AM
  • User197322208 posted

    want to perform operation edit,details and delete..please reply how can i do that...send me any demo example link...because i am totally fresher in mvc

    For this basic question please follow basic tutorials like MVC Music Store/NerdDinner at  http://www.asp.net/mvc/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 15, 2011 4:43 AM