Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Part 144 How to check if the request method is a GET or a POST in MVC

  • kudvenkat
  • 2013-09-16
  • 43340
Part 144   How to check if the request method is a GET or a POST in MVC
GETPOSTMVCcheckrequestmethodmvc get or postc# mvc get or postc# mvc get post requestmvc get vs postmvc httpget vs httppostmvc http get vs http postdifference between httpget and httppost mvcmvc request get or postmvc request.httpmethod
  • ok logo

Скачать Part 144 How to check if the request method is a GET or a POST in MVC бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Part 144 How to check if the request method is a GET or a POST in MVC или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Part 144 How to check if the request method is a GET or a POST in MVC бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Part 144 How to check if the request method is a GET or a POST in MVC

Text version of the video
http://csharp-video-tutorials.blogspo...

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
   / @aarvikitchen5572  

Slides
http://csharp-video-tutorials.blogspo...

All ASP .NET Text Articles
http://csharp-video-tutorials.blogspo...

All ASP .NET Slides
http://csharp-video-tutorials.blogspo...

ASP.NET Playlist
   • ASP.NET Tutorial for beginners in arabic  

All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenka...

All Dot Net and SQL Server Tutorials in Arabic
   / kudvenkatarabic  

In asp.net webforms, IsPostBack page property is used to check if the request is a GET or a POST request. If IsPostBack property returns true, then the request is POST, else the request is GET.

In asp.net mvc, use Request object's HttpMethod property to check if the request is a GET or a POST request. Let's discuss using Request.HttpMethod with an example.
1. Create a new asp.net mvc application and name MVCDemo.
2. Add HomeController using "Empty MVC controller" scaffolding template
3. Copy and paste the following code
public class HomeController : Controller
{
// Action method that responds to the GET request
[HttpGet]
public ActionResult Index()
{
ViewBag.IsPostBack = IsPostBack();
return View();
}

// Action method that responds to the POST request
[HttpPost]
[ActionName("Index")]
public ActionResult Index_Post()
{
ViewBag.IsPostBack = IsPostBack();
return View();
}

// This method checks if a request is a GET or a POST request
private bool IsPostBack()
{
return Request.HttpMethod == "POST";
}
}

4. Right click on the Index() action method in HomeController and select "Add View" from the context menu. Set
View name = Index
View engine = Razor
Create a strongly typed view = unchecked
Create a partial view = unchecked
Use a layout or master page = unchecked
Click Add.

5. Copy and paste the following code in Index.cshtml view.
[h3 style="font-family:Arial"]
IsPosback = @ViewBag.IsPostback
[/h3]

@using (@Html.BeginForm())
{
[input type="submit" value="Submit" /]
}

Build the project and navigate to http://localhost/MVCDemo/Home/Index. Notice that when you first visit the Page, a GET request is issued and hence IsPostBack = False. Now click Submit button and notice that IsPostBack = True is displayed, as a POST request is issued upon clicking the Submit button.

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]