TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Terry
NA
148
0
Pass multiple values thru RouteValueDictionary in ActionLink
Jul 30 2017 9:34 PM
Hello,
I have buttons where I want to pass Model and other parameters to the Action method of the Controller. Using RouteValueDictionary, it allows me to send only 1 Key-Value pair. How do I add more than 1 Key-Value pair ?
View Code :
@* Using RouteValueDictionary
new
RouteValueDictionary(Model) -- shows result just of page 1,
as
page value not passed &
default
is
1
new RouteValueDictionary ({ mivm = Model, page = Model.CurrentPage + 1}) --- Model
is
null
in
Controller Index Action method
button type=
"button"
id=
"btnNext"
class
=
"btn btn-sm"
title=
"Next"
onclick=
"location.href='@Url.Action("
Index
", "
Member
", new RouteValueDictionary(new { mivm = Model, page = Model.CurrentPage + 1 })) )'"
@( (Model.CurrentPage == Model.TotalPages) ?
"disabled"
:
""
)><span
class
=
"glyphicon glyphicon-step-forward"
></span></button>
*@
Controller Action Method :
public
ActionResult Index(MemberIndexViewModel mivm,
int
page = 1,
string
sort =
""
,
string
sortdir =
"asc"
) {
........
}
Where am I going wrong and How to make this working ??
Any help is highly appreciated.
Thanks,
Reply
Answers (
1
)
MVC : Binding dynamically added Checkboxes to the Model ???
when i am uploading .xls file in Asp.Net getting error: