I want to pass two values from view to controller . i.e., @Model.idText and value from textbox. here is my code:
@using HTML.BeginForm("SaveData","Profile",FormMethod.Post)
{
<a href="someLink">@Model.idText</a>
<input type="text" name="textValue"/>
<input type="submit" name="btnSubmit"/>
}
But problem is if i use “Url.ActionLink() i can get @Model.idText . By post action i can get textbox value using FormCollection . But i need to get both of this value either post or ActionLink
using ajax you can achieve this :
don’t use form & declare your attributes like this in tags:
jquery:
Hope this will be helpful.