Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hai Everybody,

Please give me a solution, for this.

In my MVC2 Project, In my controller I have a method like this.
C#
public ActionResult RclOas()
{
   cfrep = new CFReportService();
   ViewData["DCDetails"] = cfrep.GetDCDetails();
   return View();
}


In view I am calling like this.

C#
foreach (var data in (IEnumerable<cfrcloamodel>)ViewData["DCDetails"])


I want to pass run time argument to the ViewData["DCDetails"]

Please let me know how to pass a argument to ViewData in MVC2.

Thanks in advance.
Posted
Updated 20-Aug-13 5:19am
v2

1 solution

Send an Ajax Request. The below link will help you
http://fromjami.wordpress.com/2013/05/29/sending-ajax-request-when-dropdown-change-in-asp-net-mvc/[^]
Hope this helps
 
Share this answer
 
v2
Comments
nsvrao 20-Aug-13 10:46am    
How to pass the argument... Means
I want to retrieve the data by passing one argument to the service.

like cfrep.GetDCDetails(string Dcno);

how to do this..
Jameel VM 20-Aug-13 10:50am    
can you post the view code
Jameel VM 20-Aug-13 10:52am    
from where you want to pass the argument?
Jameel VM 20-Aug-13 11:04am    
Actually what you are trying to achieve?can you elaborate the question.
nsvrao 20-Aug-13 11:08am    
From View I want to pass the argument.
from a textfield I want to retrieve the data and in button click I want to transfer the data to ViewData
It is in jquery

$("#btnSelectedOrders").click(function() {

});

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900