Asp.Net Core 10: Access/Get RequestQuery String Value In Controller Using C#.Net

How to get the request querystring value in controller action in asp.net core 10 mvc uing c#.net.
In today's article I will show you how you can access the request query string value in asp.net core 10 mvc using c#.net. 

In my pervious article I shown you Bind  Webgrid (GridView) with Entity Framework, Asp.net Core MVC, C#, SQLOpen Form MDI Parent Using C#.Net and VB.Net | Open Only One Form in MDI in C#How to Generate SQL Server Database Scripts Automatically?.

Some of my previous articles are Access Value from  appsettings.json File in Class File Using C#.NetAccess SMTP Detail from appsettings.json in Class Library Using C#.NetAsp.Net Core MVC: Entity FrameworkAsp.Net Core MVC: Update Entity Framework for SQL ServerHow to Enable/Disable Email or SMS Communication in Asp.net Core MVC

So, for this article first we will create a new asp.net core 10 mvc application and create an httpget type method. in this methos we will pass a value parameter named as "value" of string type. 

[HttpGet]
public IActionResult Capturevalue(string value)
{
    return View();
} 
Now we will run the code to check the output. For this we will use the below link.

URL

Now add this url in address ba and click enter. It will hit the httpget method. Here Home is controller and Capturevalue is action name.

Query String Value
Here we can see that the value passed value in request querystring we are able to get in controller. 

Post a Comment