Click here to Skip to main content
15,609,498 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

It appears to be a simple query, however, I am sending a link to user with query string values. Once user access this link, fills in the details and submits the form, I am collecing the data submitted along with the query stirng.

Problem being Query string values are always null.

I have tried accessing it throuhg request, request.querystring , http context etc. Nothing works. Any idea?

What I have tried:

public class HomeController : Controller
  public ActionResult Index()
    // Code to Generate a link and sending email.
    // Link is of aformat http://localhost:1234/HomeController/Index1? 

    return View();
public ActionResult Index1()
    return View();
public ActionResult Index1(string name,string email,formCollection collection)
   // Name and email here are always null while I get the avalues in form collection,
    return View();

Updated 31-Jul-20 22:21pm

1 solution

If you have type this link
into your browser.

This action method inside your controller can catch that link above.
public ActionResult Index1(string name, string email)
  //get the values of name, email 
  return View();

Hope this helps.

Share this answer

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