17 Jul 2018 17 Jul 2018 0 Comments  18 Views
Here Mudassar Ahmed Khan has explained with an example, how to export GridView to PDF with Header Repeater on each Page using iTextSharp in ASP.Net with C# and VB.Net.

When the Export Button is clicked, a loop will be executed over the GridView Pages using PageCount property and GridView records for specific Page will be added to a new page of PDF.

Thus, using this technique each Page of PDF will have records of one Page of GridView with Header.
17 Jul 2018 17 Jul 2018 0 Comments  45 Views
Here Mudassar Ahmed Khan has explained with an example, how to Call Controller’s Action method on DropDownList Change (SelectedIndexChanged) in ASP.Net MVC Razor.

The DropDownList will be placed inside a Form and when an Item (Option) is selected, the Form will be submitted using the JavaScript onchange (SelectedIndexChanged) event handler of the DropDownList in ASP.Net MVC Razor.
16 Jul 2018 17 Jul 2018 0 Comments  236 Views
Here Mudassar Ahmed Khan has explained with an example, how to implement custom Authorization and Authentication using Forms Authentication in ASP.Net MVC Razor.

This article will illustrate how to implement a login form which validates user login from database using Forms Authentication in ASP.Net MVC Razor.
16 Jul 2018 17 Jul 2018 0 Comments  194 Views
Here Mudassar Ahmed Khan has explained with an example, how to implement and use the Authorize and AllowAnonymous Data Annotation attributes with Forms Authentication in ASP.Net MVC Razor.
16 Jul 2018 17 Jul 2018 0 Comments  169 Views
Here Mudassar Ahmed Khan has explained with an example, how to implement a simple login form using Forms Authentication which validates user login from database and also redirects user to Login page if the user is not Authenticated (logged in) and tries to access a page that requires authentication in ASP.Net MVC Razor.

The Login page URL will be set in the authentication section of the Web.Config file and the User will be redirected back to Login page if not logged in using the Authorize Data Annotation attribute in ASP.Net MVC Razor.
16 Jul 2018 16 Jul 2018 0 Comments  154 Views
Here Mudassar Ahmed Khan has explained with an example, how to store (save) GridView data in ViewState in ASP.Net using C# and VB.Net.

When a new row is added to GridView, the row data will be added to a DataTable and the DataTable will be saved in ViewState in ASP.Net.
16 Jul 2018 16 Jul 2018 0 Comments  177 Views
Here Mudassar Ahmed Khan has explained with an example, how to make ASP.Net GridView responsive with jQuery Footable using C# and VB.Net.

A responsive GridView will fit and adjust itself to look good in Mobile Phone, Tablet and Desktop displays in ASP.Net.
16 Jul 2018 16 Jul 2018 0 Comments  140 Views
Here Mudassar Ahmed Khan has explained with an example, how to save (insert) GridView Rows (Data) to Database in ASP.Net using C# and VB.Net.

First the row (data) will be saved (inserted) to database and then the GridView will be populated with the data in ASP.Net using C# and VB.Net.
13 Jul 2018 13 Jul 2018 0 Comments  305 Views
Here Mudassar Ahmed Khan has explained with an example, how to upload (Save) HTML5 Canvas Image to Server in Folder (Disk) in ASP.Net using C# and VB.Net.

For illustration purpose, the jQuery Sketch plugin will be used to allow users draw Signatures and later the HTML5 Canvas Image of the Signature will be uploaded to Server and saved as Image in Folder (Disk) using ASP.Net.
13 Jul 2018 13 Jul 2018 0 Comments  282 Views
Here Mudassar Ahmed Khan has explained with an example, how to upload and insert MP3 Audio files in SQL Server Database and then play the MP3 Audio files using HTML5 Audio Player in ASP.Net using C# and VB.Net.

The MP3 Audio files are displayed in GridView and there’s also a Download button to download the MP3 Audio files.
13 Jul 2018 13 Jul 2018 0 Comments  125 Views
Here Mudassar Ahmed Khan has explained with an example, how to make GridView TextBox ReadOnly (Disabled) in ASP.Net when Editing using C# and VB.Net.

The TextBox in ASP.Net GridView will be made ReadOnly or Disabled during the Edit Mode of GridView inside the Row being currently edited using C# and VB.Net.
11 Jul 2018 13 Jul 2018 0 Comments  346 Views
Here Mudassar Ahmed Khan has explained with an example, how to make a Column (Cell) non-editable (ReadOnly) in ASP.Net GridView when Editing using C# and VB.Net.
10 Jul 2018 10 Jul 2018 0 Comments  383 Views
Here Mudassar Ahmed Khan has explained with an example, how to populate (bind) Crystal Report using Entity Framework as Data Source in ASP.Net MVC Razor.

This article will illustrate how to configure Entity Framework and connect to SQL Server database and then finally use the Entity Framework data to populate Crystal Reports in ASP.Net MVC Razor.
10 Jul 2018 10 Jul 2018 0 Comments  333 Views
Here Mudassar Ahmed Khan has explained with an example, how to populate (bind) RDLC Report using Entity Framework as Data Source in ASP.Net MVC Razor.

This article will illustrate how to configure Entity Framework and connect to SQL Server database and then finally use the Entity Framework data as Data Source to populate RDLC Reports in ASP.Net MVC Razor.
10 Jul 2018 10 Jul 2018 0 Comments  363 Views
Here Mudassar Ahmed Khan has explained with an example, how to implement jQuery AutoComplete DropDown (ComboBox) in ASP.Net MVC 5 Razor.

The jQuery AutoComplete plugin is actually applied to a TextBox but it can be made to work as a DropDown (ComboBox) by populating the AutoComplete results on TextBox focus as well as when User types in some Text.

The data for the jQuery AutoComplete DropDown (ComboBox) will be populated from database using Entity Framework in ASP.Net MVC Razor.
06 Jul 2018 06 Jul 2018 0 Comments  508 Views
Here Mudassar Ahmed Khan has explained with an example, why Request.Browser.IsMobileDevice property does not work in ASP.Net.

ASP.Net does have in-built mobile phone browser detection capabilities and you can check whether user is using a Mobile phone browser or Desktop browser using the Request.Browser.IsMobileDevice property.

But with time, new Operating Systems and Mobile devices are being launched, thus since the information for is not present the Mobile Devices are not being detected.
06 Jul 2018 06 Jul 2018 0 Comments  414 Views
Here Mudassar Ahmed Khan has explained with an example, how to detect mobile phone browser (mobile device) in ASP.Net MVC Razor.

With the help of Regular Expressions (Regex), one can easily detect and find whether the User is using a Desktop browser or mobile phone browser (mobile device) in ASP.Net MVC Razor.
06 Jul 2018 06 Jul 2018 0 Comments  402 Views
Here Mudassar Ahmed Khan has explained with an example, how to sort (reorder) Table rows with jQuery using Drag and Drop method.

The HTML Table rows will be sorted (reordered) with Drag and Drop method using the jQuery UI Sortable Plugin.
05 Jul 2018 05 Jul 2018 0 Comments  497 Views
Here Mudassar Ahmed Khan has explained with an example, how to display Confirmation Box (Dialog) before Form Submit in ASP.Net MVC Razor.

The JavaScript Confirmation Message Box (Dialog) will be displayed using jQuery by attaching a Submit event handler to the Form.

When the Submit button is clicked, the Confirmation Message Box (Dialog) with OK (Yes) and Cancel (No) buttons will be displayed, if the User clicks OK (Yes) button only then the Form will be submitted and the Controller’s Action method will be called.
05 Jul 2018 05 Jul 2018 0 Comments  410 Views
Here Mudassar Ahmed Khan has explained with an example, how to implement confirm before Submit on ASP.Net Button Click using JavaScript.

The JavaScript Confirmation Message Box will be displayed on Button Click using ClientScript.RegisterOnSubmitStatement function.

When the Button is clicked, the Confirmation Message Box with OK (Yes) and Cancel (No) buttons will be displayed, if the User clicks OK (Yes) button only then the Form will be submitted i.e. Click event will fire.
05 Jul 2018 05 Jul 2018 0 Comments  307 Views
Here Mudassar Ahmed Khan has explained with an example, how to validate TextBox in Windows Application (WinForms) using C# and VB.Net.

The validation of TextBox will be performed using the Validating event handler and the error message will be displayed using the ErrorProvider control in Windows Application (WinForms) using C# and VB.Net.
05 Jul 2018 05 Jul 2018 0 Comments  393 Views
Here Mudassar Ahmed Khan has explained with an example, how to perform Custom Paging in WebGrid using Stored Procedure and Entity Framework in ASP.Net MVC Razor.

Custom Paging will be performed at Database level inside the Stored Procedure using the ROW_NUMBER function.

The PageIndex and PageSize values will be passed to the Stored Procedure using Entity Framework and only the specific records will be fetched and displayed in WebGrid, thus reducing the bandwidth usage.
04 Jul 2018 04 Jul 2018 0 Comments  425 Views
Here Mudassar Ahmed Khan has explained with an example, how to use multiple Submit buttons in Single Form in ASP.Net MVC Razor.

One Form can do a POST submission to one Action method in Controller and hence in order to use multiple Submit buttons inside one single Form, a Switch case has to be implemented inside the Action method.

The Switch case detects the clicked Submit button by fetching its Value from the Request.Form collection and the appropriate action is performed.
04 Jul 2018 04 Jul 2018 0 Comments  435 Views
Here Mudassar Ahmed Khan has explained with an example, how to use For Each loop for populating DropDownList using Model in ASP.Net MVC Razor.

HTML SELECT element will be created in View and a For Each loop will be executed over the Model to create and add HTML OPTION elements to the DropDownList.

The Selected Value of DropDownList is easily available using Model or using Request.Form collection, but in order to get the Selected Text, the Selected Text is copied to a Hidden Field using jQuery and then it is fetched inside Controller in ASP.Net MVC Razor.
03 Jul 2018 03 Jul 2018 0 Comments  765 Views
Here Mudassar Ahmed Khan has explained with an example, how to perform Select Insert Edit Update and Delete (CRUD) using Single Stored Procedure in ASP.Net MVC Razor.

Single Stored Procedure will be called using Entity Framework and a parameter named Action will be used to send instructions about the operation to be performed in SQL Server database. Single Stored Procedure CRUD operation will be performed by calling the Controller Action methods using jQuery AJAX and JSON in ASP.Net MVC Razor.