In mvc, you can pass arguments like so
new { A = B, C= "D", E ="F", ... }
I’d like to pass arguments like so to my own procedures, looking for links to any samples/tutorial for the same
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re not using ASP.NET MVC then you’ll need to use reflection in your method as stated in an answer above, but if you’re writing an ASP.NET MVC extension method you can use
HtmlHelper method called
AnonymousObjectToHtmlAttributeswhich createsRouteValueDictionaryfrom anonymous object or use RouteValueDictionary constructor that takes anonymous object to initialize its values.