Search Results
Results 1 - 20 of 34
Your query returned 34 results.
10 Apr 2021 10 Apr 2021 0 Comments  13163 Views
ASP.Net  MVC  Form
Here Mudassar Ahmed Khan has explained n with an example, how to pass (send) data from one cshtml page (View) to another in ASP.Net MVC Razor.

The data from the Source cshtml page (View) will be posted (submitted) using Form Post to the Controller’s Action method of the Destination cshtml page (View).

Then finally, the received data will be displayed in the Destination cshtml page (View) using ViewBag.
19 Feb 2021 19 Feb 2021 0 Comments  7926 Views
Here Mudassar Ahmed Khan has explained with an example, how to populate (bind) DropDownList using SelectListItem in ASP.Net MVC Razor.

The records from the database will be populated into a Generic List collection of SelectListItem class objects and then will be saved into a ViewBag object.

Inside the View, the ViewBag object will be passed to the Html.DropDownList Helper function for populating the DropDownList in ASP.Net MVC Razor.
18 Jan 2021 18 Jan 2021 0 Comments  23142 Views
Here Mudassar Ahmed Khan has explained with an example, how to pass data from View to Controller using ViewBag in ASP.Net MVC Razor.

ViewBag itself cannot be used to send data from View to Controller and hence we need to make use of Form and Hidden Field in order to pass data from View to Controller in ASP.Net MVC Razor.
07 Jan 2021 07 Jan 2021 0 Comments  5480 Views
Here Mudassar Ahmed Khan has explained with an example, how to read (get) value of ViewBag using JavaScript in ASP.Net MVC Razor.

The value of the ViewBag will be read using Razor Syntax in JavaScript and the value will be displayed in JavaScript Alert Message Box.
31 Dec 2020 31 Dec 2020 0 Comments  34456 Views
Here Mudassar Ahmed Khan has explained with an example, how to set ViewBag using JavaScript or jQuery in ASP.Net MVC Razor.

ViewBag is created on Server Side of the Web application and hence it is not possible to directly set it on Client Side using JavaScript or jQuery.

Thus, only possible way is to set it by making an AJAX call to the Controller’s Action method using jQuery AJAX function in ASP.Net MVC Razor.
03 Nov 2020 03 Nov 2020 1 Comments  11030 Views
Here Mudassar Ahmed Khan has explained with an example, how to bind (populate) jQuery jsTree TreeView plugin from Database in ASP.Net Core MVC.

The records from Database will be fetched using Entity Framework and a JSON string will be generated and assigned to the ViewBag object.

Finally, the JSON string in the ViewBag object will be used as source data for the jsTree TreeView plugin in ASP.Net Core MVC.
22 Jan 2020 22 Jan 2020 0 Comments  7159 Views
ASP.Net  MVC  Core
Here Mudassar Ahmed Khan has explained a short tutorial with example on how to use ViewBag in ASP.Net MVC Core 2.1.

ViewBag is a wrapper written over ViewData in order to make it easier to use and it was present in ASP.Net MVC Razor and now continued in ASP.Net MVC Core.
04 Jan 2020 04 Jan 2020 0 Comments  28787 Views
Here Mudassar Ahmed Khan has explained with an example, how to display message from Controller in View using JavaScript Alert MessageBox in ASP.Net MVC Core.

The message sent from Controller to View will be displayed in JavaScript Alert MessageBox using ViewBag object in ASP.Net MVC Core.
19 Jun 2019 19 Jun 2019 1 Comments  21890 Views
Here Mudassar Ahmed Khan has explained with an example, how to display Image after upload using FileUpload in ASP.Net MVC Razor.

The Image will be uploaded using FileUpload element and inside the Controller, the Image will be saved into a Folder (Directory) while the URL of the Image will be assigned to a ViewBag object which will be later used for displaying the Image inside the Image element in View in ASP.Net MVC Razor.
18 Apr 2019 19 Apr 2019 1 Comments  15571 Views
Here Mudassar Ahmed Khan has explained with an example, how to pass (send) Array from Controller to View using ViewBag in ASP.Net MVC Razor.

The List Collection will be populated from Database using ADO.Net inside the Controller and it will be converted to Array and passed to the View using ViewBag.

Later in View, the Array will be iterated and the data will be displayed with the help of HTML Table in ASP.Net MVC Razor.
18 Apr 2019 19 Apr 2019 0 Comments  30924 Views
Here Mudassar Ahmed Khan has explained with an example, how to pass (send) List from Controller to View using ViewBag in ASP.Net MVC Razor.

The List Collection will be populated from Database using ADO.Net inside the Controller and it will be passed to the View using ViewBag.

Later in View, the List Collection will be iterated and the data will be displayed with the help of HTML Table in ASP.Net MVC Razor.
06 Dec 2018 06 Dec 2018 0 Comments  27074 Views
Here Mudassar Ahmed Khan has explained with an example, how to enable or disable TextBox based on condition in ASP.Net MVC Razor.

A Boolean value will be stored in a ViewBag object based on some condition inside the Controller’s Action method and the value of the ViewBag object will be used to enable or disable the TextBox in View.
04 Dec 2018 04 Dec 2018 0 Comments  16083 Views
Here Mudassar Ahmed Khan has explained with an example, how to set Label value inside Controller in ASP.Net MVC Razor.

This article will illustrate how to set value of Label in ViewBag object inside Controller and later use the ViewBag object to set value in Label inside View in ASP.Net MVC Razor.
04 Dec 2018 04 Dec 2018 0 Comments  20856 Views
Here Mudassar Ahmed Khan has explained with an example, how to assign (set) ViewBag value in Label in ASP.Net MVC Razor.

This article will illustrate how to use ViewBag to set value in Label created using Html.Label helper function in ASP.Net MVC Razor.
30 Nov 2018 30 Nov 2018 0 Comments  21111 Views
Here Mudassar Ahmed Khan has explained with an example, how to assign ViewBag value to TextBox in ASP.Net MVC Razor.

This article will illustrate how to assign ViewBag value to TextBox created using Html.TextBox helper function in ASP.Net MVC Razor.
26 Nov 2018 26 Nov 2018 0 Comments  15477 Views
Here Mudassar Ahmed Khan has explained with an example, how to set Hidden Field value inside Controller in ASP.Net MVC Razor.

This article will illustrate how to set value of Hidden Field created using Html.Hidden helper function using ViewBag object in ASP.Net MVC Razor.
23 Nov 2018 23 Nov 2018 0 Comments  6995 Views
Here Mudassar Ahmed Khan has explained with an example, how to assign (set) value to TextBox using ViewBag in ASP.Net MVC Razor.

This article will illustrate how to use ViewBag to set value in TextBox created using Html.TextBox helper function in ASP.Net MVC Razor.
22 Nov 2018 22 Nov 2018 0 Comments  33619 Views
ASP.Net  HTML  MVC
Here Mudassar Ahmed Khan has explained with an example, how to assign (set) ViewBag value to Hidden Field in ASP.Net MVC Razor.

The ViewBag object value will be set inside Controller and then inside the View, the value will be assigned to the Hidden Field created using Html.Hidden helper function in ASP.Net MVC Razor.
15 Nov 2018 15 Nov 2018 0 Comments  4497 Views
Here Mudassar Ahmed Khan has explained with an example, how to pass (send) data from Controller to View using ViewBag in ASP.Net MVC Razor.

This article will illustrate how to create a ViewBag object, store some data and then access the ViewBag object inside the View using Razor syntax in ASP.Net MVC Razor.
14 Nov 2018 14 Nov 2018 0 Comments  52825 Views
ASP.Net  MVC  Form
Here Mudassar Ahmed Khan has explained with an example, how to pass (send) data from one View to another in ASP.Net MVC Razor.

The data from the Source View will be posted (submitted) using Form Post to the Controller’s Action method of the Destination View.

Then finally, the received data will be displayed in the Destination View using ViewBag.
Results 1 - 20 of 34