Click here to Skip to main content
15,921,279 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All
I have a windows application that has a link that when clicked it sends two parameters to an MVC application and both need to display. These parameters are on the URL like this :

When I accept the parameters on my MVC application the Employee parameter is NULL but the Name does have a value and I am not sure why this is. When I accept the parameters I use a session so that I do not lose the value. Below is my action method:
public ActionResult Intro(string Name, string Employee)
         if (!string.IsNullOrEmpty(Name) || !string.IsNullOrEmpty(Employee))
             Session["Name"] = Name;
             Session["Employee"] = Employee;

             string strName = string.Empty;
             string strEmployee = string.Empty;

              if (Session["Name"] != null)
                 strName = Session["Name"].ToString();
              if (Session ["Employee"] != null)
                 strEmployee = Session["Employee"].ToString();

         ViewBag.ClientFirstName = strName;
         ViewBag.Employee = strEmployee;

           return View();

1 solution

Please Specify the controller and ActionResult and then Try
Hope this helps
Share this answer
P.C Shabangu 6-Sep-13 2:46am    
thanx Jameel this does work, but what if I want to display the same information on a different View which is called by a different Controller?
Jameel VM 6-Sep-13 4:50am    
post it as a separate question by eloborating your requirement.Ofcouse will help you.

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