Category - JavaScript
Results 1 - 20 of 537
21 Jan 2022 21 Jan 2022 0 Comments  307 Views
Here Mudassar Khan has explained with an example, how to get the ID of Button inside ASP.Net GridView when clicked using JavaScript.

When the Button is clicked, a JavaScript function is called and the ID will be fetched and displayed using JavaScript Alert Message Box.
19 Jan 2022 19 Jan 2022 0 Comments  372 Views
Here Mudassar Khan has explained with an example, how to get Session value in JavaScript or jQuery in ASP.Net Core MVC.

JavaScript is a Client Side language and hence directly it is not possible to get Session value in JavaScript.

Thus, the solution is to make an AJAX call using jQuery AJAX function and pass the value of JavaScript variable to a Controller and inside the Controller the value is retrieved from Session object in ASP.Net Core MVC.
19 Jan 2022 19 Jan 2022 0 Comments  290 Views
Here Mudassar Khan has explained with an example, how to get the ID of Button inside ASP.Net GridView when clicked using jQuery.

When the Button is clicked, a jQuery Click event handler will be called and the ID will be fetched and displayed using JavaScript Alert Message Box.
28 Oct 2021 28 Oct 2021 0 Comments  2203 Views
Here Mudassar Ahmed Khan has explained with an example, how to get HttpContext.Current.Session value in JavaScript or jQuery with ASP.Net.

Session object or Session variable is stored on Server and hence in order to get its value in JavaScript or jQuery, an AJAX call will be done to the Server Side method in ASP.Net using C# and VB.Net.
28 Oct 2021 28 Oct 2021 0 Comments  2332 Views
Here Mudassar Ahmed Khan has explained with an example, how to display TextBox value in JavaScript Alert Box using jQuery.

When the Button is clicked, the TextBox value is displayed in the JavaScript Alert Box.
28 Oct 2021 28 Oct 2021 0 Comments  2197 Views
Here Mudassar Ahmed Khan has explained with an example, how to get Session value in JavaScript in ASP.Net MVC Razor.

JavaScript is a Client Side language and hence directly it is not possible to get Session value in JavaScript.

Thus, the solution is to make an AJAX call using jQuery AJAX function and pass the value of JavaScript variable to a Controller and inside the Controller the value is retrieved from Session object in ASP.Net MVC Razor.
24 Sep 2021 24 Sep 2021 0 Comments  6655 Views
Here Mudassar Ahmed Khan has explained with an example, how to save BLOB (Binary Data) as PDF file using JavaScript.

The PDF file will be downloaded as BLOB (Binary Data) using XmlHttpRequest AJAX call and then will be sent for download in the Browser using JavaScript.
24 Sep 2021 24 Sep 2021 0 Comments  1259 Views
Here Mudassar Ahmed Khan has explained with an example, how to save BLOB (Binary Data) as file using JavaScript.

The BLOB (Binary Data) sent from Server will be received using XmlHttpRequest AJAX call and then will be sent for download in the Browser using JavaScript.
13 Aug 2021 13 Aug 2021 0 Comments  3053 Views
Here Mudassar Ahmed Khan has explained with an example, how to call (consume) Web API 2 using JavaScript XmlHttpRequest (XHR) and AJAX in ASP.Net Core MVC.

This article will explain how to make a POST call to Web API 2 Controller’s method using JavaScript XmlHttpRequest (XHR) and AJAX in ASP.Net Core MVC.
13 Aug 2021 13 Aug 2021 0 Comments  1802 Views
Here Mudassar Ahmed Khan has explained with an example, how to call (consume) Web API 2 using JavaScript XmlHttpRequest (XHR) and AJAX in ASP.Net MVC Razor.

This article will explain how to make a POST call to Web API 2 Controller’s method using JavaScript XmlHttpRequest (XHR) and AJAX in ASP.Net MVC Razor.
09 Aug 2021 09 Aug 2021 0 Comments  2635 Views
Here Mudassar Ahmed Khan has explained with an example, how to get MIME Type (Content Type) of a File in JavaScript.
13 Apr 2021 13 Apr 2021 0 Comments  2530 Views
Here Mudassar Ahmed Khan has explained with an example, how to display a message before redirecting in ASP.Net MVC Razor.

When a Button is clicked, first an operation will be performed, then a message will be displayed using JavaScript Alert Message Box and finally the page will be redirected in ASP.Net MVC Razor.
10 Apr 2021 10 Apr 2021 0 Comments  5105 Views
Here Mudassar Ahmed Khan has explained with an example, how to show Alert Message Box on Button Click in ASP.Net MVC Razor.

The Alert Message Box will be shown using JavaScript in ASP.Net MVC Razor.
09 Apr 2021 09 Apr 2021 0 Comments  8281 Views
Here Mudassar Ahmed Khan has explained with an example, how to display message using JavaScript Alert MessageBox in ASP.Net Core Razor Pages.

The message sent from Razor PageModel (Code-Behind) to Razor PageModel (HTML) will be displayed in JavaScript Alert MessageBox using ViewData object.
15 Jan 2021 15 Jan 2021 0 Comments  4521 Views
Here Mudassar Ahmed Khan has explained with an example, how to change the default Camel Case JSON Output in ASP.Net Core.

The default Camel Case JSON property names tend to break the Client Side JavaScript and hence in order to remove it, the default JSON Serialization needs to be replaced with Newtonsoft.Json Serialization in ASP.Net Core.
12 Jan 2021 12 Jan 2021 0 Comments  5354 Views
Here Mudassar Ahmed Khan has explained with an example, how to read (get) value of TempData using JavaScript in ASP.Net MVC Razor.

The value of the TempData will be read using Razor Syntax in JavaScript and the value will be displayed in JavaScript Alert Message Box.
12 Jan 2021 12 Jan 2021 0 Comments  5547 Views
Here Mudassar Ahmed Khan has explained with an example, how to read (get) value of ViewData using JavaScript in ASP.Net MVC Razor.

The value of the ViewData will be read using Razor Syntax in JavaScript and the value will be displayed in JavaScript Alert Message Box.
07 Jan 2021 07 Jan 2021 0 Comments  2165 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  15120 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.
31 Dec 2020 31 Dec 2020 0 Comments  7680 Views
Here Mudassar Ahmed Khan has explained with an example, how to set ViewData using JavaScript or jQuery in ASP.Net MVC Razor.

ViewData 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.
Results 1 - 20 of 537