Controllers & Passing Value to Controller Via URL – Session 14

Controllers & Passing Value to Controller Via URL – Session 14

Golden Courses

3 года назад

163 Просмотров

In this session of ASP.NET Core Tutorial, we continue our discussion about Controllers. Also we talk about passing value to Controller and Action method via URL and user request.

What is Controller in ASP.NET Core?
Generally Controller is a Class that implemented from Controller base Class. Its name has Controller suffix and each Controller has several Method that calls Action Method. Action Methods are responsible for processing requests.

In session 10, 11 and 12 we discussed about MVC structure and Routing which were related to this session. Thus if you have not review those sessions, we highly recommend reviewing mentioned sessions before starting this session.

Passing Data to Controllers Via Routing Pattern and Action Method Input Parameters
We can modify our Web App routing pattern to enable it to receive our required data via URL. Then we can have access to that data in the called Action Method through Input Parameters.

Passing Data to Action Method via Query String and Input Parameters
Moreover, end-users can send their data to Action Method through Query String. Then, same as pervious way, you can have access to provided data in Action Method with Input Parameters.


Passing Value to Action Method via Query String and Request.Query
Last but not least, we can send data to our Action Request with Query String same as previous example. But this time we don’t need to mentioned our Query String name as Input Parameters. Rather, Action Method can have access to the passed data via Request.Query method.

Tutorial Playlist
https://bit.ly/3lxQP9n

Our Social Media
Facebook: https://bit.ly/310ksqA
Instagram: https://bit.ly/3cOq4th
Telegram: https://bit.ly/3s4mzWc

Text Version of course:
https://www.goldencourses.net/controller-passing-value-to-controller-via-url/

Тэги:

#ASP.NET_Core_Tutorial #ASP.NET_Core #ASP.NET_5.0 #ASP.NET_Core_MVC #CSharp #Programming_Tutorial #MVC
Ссылки и html тэги не поддерживаются


Комментарии: