1
Reply

passing data from view to another by actionlink in mvc

divya reddy

divya reddy

Nov 23 2016 11:11 PM
173
Hello im having a view when i click on forget password link i have to retrieve the particular user details and display in another view this is my login view:
@Html.LabelFor(model => model.Username, new { @class = "col-sm-4" })
@Html.TextBox("txtUsername")
@Html.LabelFor(model => model.Password, new { @class = "col-sm-4" })
@Html.TextBox("txtPassword")
@Html.ActionLink("Forget Password", "EmployeeDetails", "Home", new { username = "Username"}, null)
When i click on forget password action link i have to redirect to another view and display the data of that particular user information.
 
im Redirecting to forget password page but i not able to display the data in database.
 Displaying data of forget password view:
@Html.LabelFor(model => model.Username, new { @class = "col-sm-4" })
@Html.TextBoxFor(model => model.Username, new { @readonly = "readonly", @class = "col-sm-8" })
@Html.LabelFor(model => model.HintQueation1, new { @class = "col-sm-4" })
@Html.TextBoxFor(model => model.HintQueation1, new { @readonly = "readonly", @class = "col-sm-8" })
@Html.LabelFor(model => model.HintQueation2, new { @class = "col-sm-4" })
@Html.TextBoxFor(model => model.HintQueation2, new { @readonly = "readonly", @class = "col-sm-8" })
@Html.LabelFor(model => model.HintQueation3, new { @class = "col-sm-4" })
@Html.TextBoxFor(model => model.HintQueation3, new { @readonly = "readonly", @class = "col-sm-8" })
Im using entity framework.
and to retrieve what code have to write in controller
and how to pass particular user entered in textboxes in action link
Please help me out.
Thanks and Regards,
Divya reddy.

Answers (1)