'How to set web URL parameters while debugging asp.net locally?
I'm locally debugging a page that runs on our server. The page normally has ?Parameters.
How do I set those when debugging locally?
Solution 1:[1]
All you need to do is append the values to your querystring and then set breakpoints in the code-behind or controller. For example, if have a page at this url:
You can access the querystring parameters like this:
var foo = Request.Querystring["Parameters"]
Here's a link with a little more instruction.
Solution 2:[2]
If your starting page is to contain querystring parameters, you can specify the page with a querystring value in the Start Options for the project.
Start Options - Visual Studio 2022
the URL to use as localhost is visible in the project properties project properties
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Daniel Szabo |
| Solution 2 | Edward T Wood |
