Asp.net Tutorials

1. Things to note when changing a function to async in your controller

By: Linda Ng : 2023-06-01

Description: When changing a function to an asynchronous function, there are several things to note


2. AmbiguousMatchException: The request matched multiple endpoints.

By: Manoj : 2023-06-01

Description: The AmbiguousMatchException you encountered means that there are multiple endpoints in your code that match the incoming request. This can happen when you have multiple actions in a controller with the same name and same HTTP verb


3. Call an Action in a controller when user clicks a button in View

By: Manoj : 2023-06-01

Description: Let us assume you have a button in your view whose id is 'authorizeButton' and you want to submit to your Action named 'Authorize' in your controller named 'SandboxApi'. To call the Authorize action in the SandboxApiController when the user clicks the button, you can follow these steps


4. Button that is only clickable when the checkbox is checked

By: Niraj : 2023-06-01

Description: To implement a checkbox and a button that is only clickable when the checkbox is checked, you can use JavaScript/jQuery. Here's an example of how you can achieve this


5. Pass the same model to multiple views within the same controller

By: Niraj : 2023-06-01

Description: To pass the same model to multiple views within the same controller, you can make use of the ViewBag property or strongly typed views


6. Severity Code Description Project File Line Suppression State Error CS0103 The name 'Encoding' does not exist in the current context

By: Niraj : 2023-06-01

Description: Severity Code Description Project File Line Suppression State Error CS0103 The name 'Encoding' does not exist in the current context


7. Severity Code Description Project File Line Suppression State Error CS0103 The name 'JsonConvert' does not exist in the current context.

By: Niraj : 2023-06-01

Description: Severity Code Description Project File Line Suppression State Error CS0103 The name 'JsonConvert' does not exist in the current context.


8. Passing a model globally to all Views in your Asp.net webapp

By: Terrence : 2023-06-01

Description: Let us say you have a model named customerSettings that you initialize when the user logs in and then you want to save it globally for later use throughout the application in all views


9. Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'JToken' could not be found.

By: Terrence : 2023-06-01

Description: Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'JToken' could not be found.


10. Development Mode in IIS for Asp.net projects

By: Manoj : 2023-06-01

Description: Swapping to Development environment will display more detailed information about the error that occurred. To set the ASPNETCORE_ENVIRONMENT environment variable in IIS, you can follow these steps