Thursday 26 September 2013






Description:-

            Here in this example I will Explain that How to Insert data into an XML File and read data From the XML File and Bind to the DataList control in asp.Net.

In Previous we also explain that How to insert data into an XML file and Bind to Gridview but here we use DataList Control.

First of all we understand what is XML:-

XML means Extensible markup language why we need to use this one because by using XML we can store the data and we can easily retrieve or read data from XML file and display the data without using database in our applications.
if we need to display dynamic data in our application it will take long time to conenct database and Fetch  data from the database but if we are  use XML to store data we can easily perform operations with xml file directly without using any connection or database. If we store data in database that is incompatible and need connection to some of the computer applications but if we store data in XML format it will support for all applications.
Now I will explain inserting data into xml and retrive data from XML and bind data to datalist with simple example.
to show Example of How to Bind XML data to Gridview click here Insert/Read from XML file and bind to Gridview

to Download the Complete Project plz click below Download Image Link
download here!

How to Insert Data into XML File and Bind XML Data to DataList Control in Asp.Net






Description:-

            Here in this example I will Explain that How to Insert data into an XML File and read data From the XML File and Bind to the DataList control in asp.Net.

In Previous we also explain that How to insert data into an XML file and Bind to Gridview but here we use DataList Control.

First of all we understand what is XML:-

XML means Extensible markup language why we need to use this one because by using XML we can store the data and we can easily retrieve or read data from XML file and display the data without using database in our applications.
if we need to display dynamic data in our application it will take long time to conenct database and Fetch  data from the database but if we are  use XML to store data we can easily perform operations with xml file directly without using any connection or database. If we store data in database that is incompatible and need connection to some of the computer applications but if we store data in XML format it will support for all applications.
Now I will explain inserting data into xml and retrive data from XML and bind data to datalist with simple example.
to show Example of How to Bind XML data to Gridview click here Insert/Read from XML file and bind to Gridview

to Download the Complete Project plz click below Download Image Link
download here!

Wednesday 25 September 2013





Description:-

            Here in this example we will Explain that how to Read and Write Text File in Asp.Net using C#.Net.


Reading and Writing text file content in asp.net it’s very simple but  we need to use name space called 

using System.IO;

The System.IO namespace contains types that allow reading and writing to files and data streams and types that provide basic file and directory support.

This is very useful Example because Read and Write file in application is very Required when we working with upload file database and again read or modify this file in database.

After that in code we will use Class File to get properties like

File.WriteAllLines: Creates a new file, writes one or more strings to the file, and then closes the file.

File.ReadAllLines: Opens a text file, reads all lines of the file into a string array, and then closes the file.

File.AppendAllText: Appends lines to a file, and then closes the file.

Here I am creating file in this path D:\kirit\MyTest.txt first I will create text file in this path after that I will read the text from this text file and I will display that text in textbox.

Design your aspx page like this

how to Read and Write Data into text file using asp.net with C#





Description:-

            Here in this example we will Explain that how to Read and Write Text File in Asp.Net using C#.Net.


Reading and Writing text file content in asp.net it’s very simple but  we need to use name space called 

using System.IO;

The System.IO namespace contains types that allow reading and writing to files and data streams and types that provide basic file and directory support.

This is very useful Example because Read and Write file in application is very Required when we working with upload file database and again read or modify this file in database.

After that in code we will use Class File to get properties like

File.WriteAllLines: Creates a new file, writes one or more strings to the file, and then closes the file.

File.ReadAllLines: Opens a text file, reads all lines of the file into a string array, and then closes the file.

File.AppendAllText: Appends lines to a file, and then closes the file.

Here I am creating file in this path D:\kirit\MyTest.txt first I will create text file in this path after that I will read the text from this text file and I will display that text in textbox.

Design your aspx page like this

Sunday 22 September 2013







Here I will explain how to use Ajax password strength control to display the password strength during registration of user using asp.net.

Description: 

in this Example we Explain that how to use Ajax Password Strength control to check the password strength during user is fillup the Registration forn in Asp.Net.

In this Example we Create one registration page that allows users to register in website at that time I need to check the password length, number of minimum characters required and number of minimum numbers and special characters required and so more and at the same time I need to check the password strength like poor, average, good etc. To display that’s type of  requirement we used Ajax Password strength control to display password strength. 

Here we can display password strength in two styles 

      1) Text
     2) BarIndicator

Now I can explain how to show the basic password strength using Text indicatortype with Ajax passwordStrength control.

First add AjaxControlToolkit reference to your application and design your aspx page like this
There are some importtant Property of the Ajax Password Strength Control are as follows:

TargetControlID – we need to give ID of the textbox for which we need to check password strength. 

DisplayPosition – This property are used to adjust the Positioning of the strength indicator relative to the target control like TextBox.

StrengthIndicatorType – This property is used to select Strength indicator type (Text or BarIndicator)

PrefixText - This property is used display prefix text to check password range text (ex: Strength: Average) when StrengthIndicatorType=Text

TextCssClass – This property is used to apply CSS class or formatting to the text display when StrengthIndicatorType=Text



PreferredPasswordLength - This property is used to select preferred length of the password like 6 to 8 character.

MinimumNumericCharacters –This property is used to specify number of minimum numeric characters required.

MinimumSymbolCharacters - This property is used to specify number of minimum symbol characters (ex: $ ^ *) required.

RequiresUpperAndLowerCaseCharacters - This property is used to specify whether mixed case characters are required

MinimumLowerCaseCharacters - This property’s effects apply only when RequiresUpperAndLowerCaseCharacters property is true.and that are used to Specifies the minimum number of lowercase characters required when requiring mixed case characters as part of your password strength considerations.

MinimumUpperCaseCharacters - This property’s effects apply only when RequiresUpperAndLowerCaseCharacters property is true.and that are used to Specifies the minimum number of uppercase characters required when requiring mixed case characters as part of your password strength considerations.

TextStrengthDescriptions - This property is used to specify List of semi-colon separated descriptions used (poor; Weak; Average; Good) when StrengthIndicatorType=Text (Minimum of 2, maximum of 10; order is weakest to strongest)

CalculationWeightings - This property is used to define List of semi-colon separated numeric values used to determine the weighting of a strength characteristic. It must be total of 100. The default weighting values are defined just like this as 50;15;15;20.

BarBorderCssClass - This CSS class applied to the bar indicator's border when StrengthIndicatorType=BarIndicator

BarIndicatorCssClass - CSS class applied to the bar indicator's inner bar when StrengthIndicatorType=BarIndicator


HelpStatusLabelID – This Property is used to assign label ID to display help text

HelpHandleCssClass – This Property is used to assign CSSClass for help text.

HelpHandlePosition - This Property is used to define Positioning of the help handle element relative to the target control.


To show Example of Popup in Ajax click Here Modal Popup in Ajax with Asp.Net

to Show example of Nested Popup Click Here Nested Modal Popup in Ajax with Asp.Net

to show Example of AutoComplete TextBox Extender click Here AutoComplete Extender in Ajax with Asp.Net

to show Example of Password Strength Extender click Here Password Strength in Ajax with Asp.Net

Ajax password strength example for checking the password strength in AJAX with Asp.Net | Password Strength indicator in Ajax







Here I will explain how to use Ajax password strength control to display the password strength during registration of user using asp.net.

Description: 

in this Example we Explain that how to use Ajax Password Strength control to check the password strength during user is fillup the Registration forn in Asp.Net.

In this Example we Create one registration page that allows users to register in website at that time I need to check the password length, number of minimum characters required and number of minimum numbers and special characters required and so more and at the same time I need to check the password strength like poor, average, good etc. To display that’s type of  requirement we used Ajax Password strength control to display password strength. 

Here we can display password strength in two styles 

      1) Text
     2) BarIndicator

Now I can explain how to show the basic password strength using Text indicatortype with Ajax passwordStrength control.

First add AjaxControlToolkit reference to your application and design your aspx page like this
There are some importtant Property of the Ajax Password Strength Control are as follows:

TargetControlID – we need to give ID of the textbox for which we need to check password strength. 

DisplayPosition – This property are used to adjust the Positioning of the strength indicator relative to the target control like TextBox.

StrengthIndicatorType – This property is used to select Strength indicator type (Text or BarIndicator)

PrefixText - This property is used display prefix text to check password range text (ex: Strength: Average) when StrengthIndicatorType=Text

TextCssClass – This property is used to apply CSS class or formatting to the text display when StrengthIndicatorType=Text



PreferredPasswordLength - This property is used to select preferred length of the password like 6 to 8 character.

MinimumNumericCharacters –This property is used to specify number of minimum numeric characters required.

MinimumSymbolCharacters - This property is used to specify number of minimum symbol characters (ex: $ ^ *) required.

RequiresUpperAndLowerCaseCharacters - This property is used to specify whether mixed case characters are required

MinimumLowerCaseCharacters - This property’s effects apply only when RequiresUpperAndLowerCaseCharacters property is true.and that are used to Specifies the minimum number of lowercase characters required when requiring mixed case characters as part of your password strength considerations.

MinimumUpperCaseCharacters - This property’s effects apply only when RequiresUpperAndLowerCaseCharacters property is true.and that are used to Specifies the minimum number of uppercase characters required when requiring mixed case characters as part of your password strength considerations.

TextStrengthDescriptions - This property is used to specify List of semi-colon separated descriptions used (poor; Weak; Average; Good) when StrengthIndicatorType=Text (Minimum of 2, maximum of 10; order is weakest to strongest)

CalculationWeightings - This property is used to define List of semi-colon separated numeric values used to determine the weighting of a strength characteristic. It must be total of 100. The default weighting values are defined just like this as 50;15;15;20.

BarBorderCssClass - This CSS class applied to the bar indicator's border when StrengthIndicatorType=BarIndicator

BarIndicatorCssClass - CSS class applied to the bar indicator's inner bar when StrengthIndicatorType=BarIndicator


HelpStatusLabelID – This Property is used to assign label ID to display help text

HelpHandleCssClass – This Property is used to assign CSSClass for help text.

HelpHandlePosition - This Property is used to define Positioning of the help handle element relative to the target control.


To show Example of Popup in Ajax click Here Modal Popup in Ajax with Asp.Net

to Show example of Nested Popup Click Here Nested Modal Popup in Ajax with Asp.Net

to show Example of AutoComplete TextBox Extender click Here AutoComplete Extender in Ajax with Asp.Net

to show Example of Password Strength Extender click Here Password Strength in Ajax with Asp.Net

Wednesday 18 September 2013





Description:-

            In previous Example we explain that How to Extract Unzip Files to zip Folder in asp.net using C#. now in this example we explain How to Restrict the user to Upload File with Predefined length means not exceed the predefined size.

In which we Include one FileUpload Control in a webpage that Accept the File and save it in Folder when user is Upload the File but the Different is that the File is only Uploaded when the Size of File are Less than or Equal to the Predefined Size.

Here is a Code that Demostrate How to set Predefined size For File Upload in Web.Config File in asp.Net like :

<system.web>
<httpRuntime executionTimeout="9999" maxRequestLength="2097151"/>
</system.web>


Now we Explain the Above keyword that are used in Web.Config file as shown below

httpRuntime:-

that are used to for Configuring the Runtime Settings and can be Declared at the machine,site,application etc…

executionTimeout:-

that’s defines that the maximum number of second that a Request is allowed to Excute if the time is Excced the ExecutionTimeout then it will automatically shutdown the Application that is currentally running.

maxRequestLength:-

that’s defines that the maximum size of File Upload. This is the predefined size in kilobytes(KB). If Excced the predefined size then the Exception was Generated by the Application.the Default size of the File Upload is the 4096 KB(4 MB).


To Show Example of How to Upload File in MVC Application then click here upload Image and bind to Gridview in MVC

To show Example of How to Upload Multiple File in MVC Application then click here upload multiple File in MVC

How to upload File and Fetch file from SqlServer and bind to Gridview fetch file from Sqlserver and bind to Gridview

How to Restrict the size of file upload in asp.net or not Exceed the the Predefined size when File upload by user in Asp.Net





Description:-

            In previous Example we explain that How to Extract Unzip Files to zip Folder in asp.net using C#. now in this example we explain How to Restrict the user to Upload File with Predefined length means not exceed the predefined size.

In which we Include one FileUpload Control in a webpage that Accept the File and save it in Folder when user is Upload the File but the Different is that the File is only Uploaded when the Size of File are Less than or Equal to the Predefined Size.

Here is a Code that Demostrate How to set Predefined size For File Upload in Web.Config File in asp.Net like :

<system.web>
<httpRuntime executionTimeout="9999" maxRequestLength="2097151"/>
</system.web>


Now we Explain the Above keyword that are used in Web.Config file as shown below

httpRuntime:-

that are used to for Configuring the Runtime Settings and can be Declared at the machine,site,application etc…

executionTimeout:-

that’s defines that the maximum number of second that a Request is allowed to Excute if the time is Excced the ExecutionTimeout then it will automatically shutdown the Application that is currentally running.

maxRequestLength:-

that’s defines that the maximum size of File Upload. This is the predefined size in kilobytes(KB). If Excced the predefined size then the Exception was Generated by the Application.the Default size of the File Upload is the 4096 KB(4 MB).


To Show Example of How to Upload File in MVC Application then click here upload Image and bind to Gridview in MVC

To show Example of How to Upload Multiple File in MVC Application then click here upload multiple File in MVC

How to upload File and Fetch file from SqlServer and bind to Gridview fetch file from Sqlserver and bind to Gridview

Tuesday 17 September 2013





Description:-
            In Previous Example we Explain that How to Extract or Covert All Files to Zip Folder.Here we Explain that How to Download Multiple Selected File as a Zip File File From Gridview Based on CheckBox Selection in Asp.Net Using C#.
We All know that user have many thought like Download multiple File at a time and also selected Files is Download or other not. So to provide this type of Facility we can use this Example.
First using this Example we must have Download Ionic.Zip.dll from DotnetZIP Library.once download this File then you have to Add this dll file in Bin Folder of your Application.this dll are contain some code that are used to create a Zip File and just have to implement in our project.
below Image Descibe that How to add dll File in Bin Folder like
Now Create another Folder with name SampleFiles and this Folder are used for storing all uploaded file.


Before use this Example you must have to Add the Following Namespace in your Application like 

            using System.IO;
using Ionic.Zip;

To DownLoad Extract UnZip File into Zip Folder then click Here Unzip to zip File


To Download Complete Project plz Click below Download Image link
download here!

How to Download Multiple Files as Zip File From Gridview Based on CheckBox Selection in Asp.Net Using C#





Description:-
            In Previous Example we Explain that How to Extract or Covert All Files to Zip Folder.Here we Explain that How to Download Multiple Selected File as a Zip File File From Gridview Based on CheckBox Selection in Asp.Net Using C#.
We All know that user have many thought like Download multiple File at a time and also selected Files is Download or other not. So to provide this type of Facility we can use this Example.
First using this Example we must have Download Ionic.Zip.dll from DotnetZIP Library.once download this File then you have to Add this dll file in Bin Folder of your Application.this dll are contain some code that are used to create a Zip File and just have to implement in our project.
below Image Descibe that How to add dll File in Bin Folder like
Now Create another Folder with name SampleFiles and this Folder are used for storing all uploaded file.


Before use this Example you must have to Add the Following Namespace in your Application like 

            using System.IO;
using Ionic.Zip;

To DownLoad Extract UnZip File into Zip Folder then click Here Unzip to zip File


To Download Complete Project plz Click below Download Image link
download here!

Monday 16 September 2013




Description:-

            Here in this Example I will Explain that How to Extract or Unzip or Convert Files into the Zip Folder in Asp.Net using C#.Net.

We all know that in Internet If you want to Download Multiple Files at a time then we must First have to Extract All Selected File into an Zip Folder then user can Download that Project.

So Implement this Functionality in our Application we must First have to Download the  Ionic.Zip.dll from DotnetZIP Library.once you Download the File then you have to add the dll File into the Bin Folder of your project like as shown in Following Image.






Now Add the SampleFiles folder in your Application for storing the Zip Folder.




Before use this Example you must have to Add the Following Namespace in your Application like 

            using System.IO;
using Ionic.Zip;




Here  Ionic.Zip  is the dll File that we Include in the Bin Folder. And Using the Functionality of the Extract Unzip Files to Zip Folder we must Include this Namespace.

to Download multiple File as Zip File then click here download multiple file as Zip file

To Download the Complete Project then Click on the below Download Image Link
download here!

Extract Unzip Files into Zip Folder or Covert Unzip Files to Zip in Asp.net using C#




Description:-

            Here in this Example I will Explain that How to Extract or Unzip or Convert Files into the Zip Folder in Asp.Net using C#.Net.

We all know that in Internet If you want to Download Multiple Files at a time then we must First have to Extract All Selected File into an Zip Folder then user can Download that Project.

So Implement this Functionality in our Application we must First have to Download the  Ionic.Zip.dll from DotnetZIP Library.once you Download the File then you have to add the dll File into the Bin Folder of your project like as shown in Following Image.






Now Add the SampleFiles folder in your Application for storing the Zip Folder.




Before use this Example you must have to Add the Following Namespace in your Application like 

            using System.IO;
using Ionic.Zip;




Here  Ionic.Zip  is the dll File that we Include in the Bin Folder. And Using the Functionality of the Extract Unzip Files to Zip Folder we must Include this Namespace.

to Download multiple File as Zip File then click here download multiple file as Zip file

To Download the Complete Project then Click on the below Download Image Link
download here!

Sunday 15 September 2013






Description:-

            In this Example we explain that How to Delete Multiple Record at a time in Gridview in MVC. Here we Define Header Checkbox through which you can select All checkbox just in ane click and when you click on the Delete button ther all Selected Record are Deleted Successfully.

Generally in Simple Grid View that is very easy to Delete Multiple Record but in MVC that is a Difficult task here we Describe the Delete Function in MVC that are used to Delete the Selected Rows.

in which we provide Facility to user that is user can just click on Header checkbox and select all Row or Record that are Exist in Gridview and when click on Delete button then all selected or checked rows are deleted. we also provide a confirmation box before deleting the record same as provide in Gmail Inbox.

For Example:-

            [HttpPost]
        public ActionResult Assign(FormCollection form)
        {
            //get collection of selected ids
            var chckedValues = form.GetValues("assignChkBx");

            //You can use each object if u wish from id
            foreach (var id in chckedValues)
            {
                poll p = new poll();
                var pp =(from ss in dc.polls where ss.Id == Convert.ToInt32(id) select ss).First();
                dc.polls.DeleteOnSubmit(pp);
                dc.SubmitChanges();
                //get object example..  Customer Customer = Customers.find(id);
                //Your Method here like send an item to customer
            }
            return RedirectToAction("index");
        }

 Also how to Display Header CheckBox in WebGrid in MVC code are as follows:

grid.Column(header: "{CheckBoxHeading}",  format:@<text><input class="box"  id="assignChkBx"name="assignChkBx" type="checkbox" value="@item.Id"/></text>),

Rows. Before used this Example you have to create a table in Database are as Follow:



MVC Registration form with all Validation in MVC client and server side validation in MVC4

Insert,Update,Delete in Gridview without postback CRUD operation without refresh the page


Upload multiple Files with Progressbar upload multiple file at a time with progressbar


upload image in database using Image Datatype upload image in database having datatype is image

To Download Complete project then click on Below Download Image Link
download here!

MVC Example For Delete Multiple Record in Gridview based on CheckBox Selection in MVC4






Description:-

            In this Example we explain that How to Delete Multiple Record at a time in Gridview in MVC. Here we Define Header Checkbox through which you can select All checkbox just in ane click and when you click on the Delete button ther all Selected Record are Deleted Successfully.

Generally in Simple Grid View that is very easy to Delete Multiple Record but in MVC that is a Difficult task here we Describe the Delete Function in MVC that are used to Delete the Selected Rows.

in which we provide Facility to user that is user can just click on Header checkbox and select all Row or Record that are Exist in Gridview and when click on Delete button then all selected or checked rows are deleted. we also provide a confirmation box before deleting the record same as provide in Gmail Inbox.

For Example:-

            [HttpPost]
        public ActionResult Assign(FormCollection form)
        {
            //get collection of selected ids
            var chckedValues = form.GetValues("assignChkBx");

            //You can use each object if u wish from id
            foreach (var id in chckedValues)
            {
                poll p = new poll();
                var pp =(from ss in dc.polls where ss.Id == Convert.ToInt32(id) select ss).First();
                dc.polls.DeleteOnSubmit(pp);
                dc.SubmitChanges();
                //get object example..  Customer Customer = Customers.find(id);
                //Your Method here like send an item to customer
            }
            return RedirectToAction("index");
        }

 Also how to Display Header CheckBox in WebGrid in MVC code are as follows:

grid.Column(header: "{CheckBoxHeading}",  format:@<text><input class="box"  id="assignChkBx"name="assignChkBx" type="checkbox" value="@item.Id"/></text>),

Rows. Before used this Example you have to create a table in Database are as Follow:



MVC Registration form with all Validation in MVC client and server side validation in MVC4

Insert,Update,Delete in Gridview without postback CRUD operation without refresh the page


Upload multiple Files with Progressbar upload multiple file at a time with progressbar


upload image in database using Image Datatype upload image in database having datatype is image

To Download Complete project then click on Below Download Image Link
download here!
This entry was posted in :

Thursday 12 September 2013






Description:-

            In this Example we Explain that How to Call a Asp.Net Serverside method or Codebehind Method that we wiil Define in Aspx.cs File are Call From Jquery.

To Call this Method From Jquery First we have to Create a those Method With a [WebMethod] Attribute in our Code behind file and then after we can easily call this Method From Jquery.


If we want to call our Code behind methods using JQuery then we need to use JQuery.ajax method and our JQuery declaration will be declared as follows :

$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "yourpage.aspx/yourmethod",
data: "{}",
dataType: "json",
success: function(data) {
//Write functionality to display data
},
error: function(result) {
alert("Error");
}
});

In above Declaration we are using this JSON function to call [WebMethod] using JQuery $.ajax() whenever we need to make Ajax call with JQuery then we will use JSON functions like as we mentioned in above format. Here type, ContentType and dataType are same for all functions only url, data and success and error parameters will vary based on our requirement.

url: This is the Full path of our Webmethods that we are defined in Code behind File.

data: through this property we will pass the parameter to the method, if no parameters then we need to use data: "{}"

success: through this property when our [WebMethod] is Exccuted completely then success function will execute and return required data

error: This parameter is used to display the error message whenever we get an Exception.

Now Just Copy the Below Code and paste it in your Aspx page.

Before using this you must have to include the Namespace like

using System.Web.Services;

and Method is must Static with [WebMethod] Attribute


Fancy Slide Show of Image Gallery in JQuery Image slide show in Jquery

how to Disable Browser back button functionality using javascript Disable browser back button

Delete multiple record in gridview with checkbox selection Delete multiple record in gridview


How to call asp.net Code behind page methods from JSON or JQuery






Description:-

            In this Example we Explain that How to Call a Asp.Net Serverside method or Codebehind Method that we wiil Define in Aspx.cs File are Call From Jquery.

To Call this Method From Jquery First we have to Create a those Method With a [WebMethod] Attribute in our Code behind file and then after we can easily call this Method From Jquery.


If we want to call our Code behind methods using JQuery then we need to use JQuery.ajax method and our JQuery declaration will be declared as follows :

$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "yourpage.aspx/yourmethod",
data: "{}",
dataType: "json",
success: function(data) {
//Write functionality to display data
},
error: function(result) {
alert("Error");
}
});

In above Declaration we are using this JSON function to call [WebMethod] using JQuery $.ajax() whenever we need to make Ajax call with JQuery then we will use JSON functions like as we mentioned in above format. Here type, ContentType and dataType are same for all functions only url, data and success and error parameters will vary based on our requirement.

url: This is the Full path of our Webmethods that we are defined in Code behind File.

data: through this property we will pass the parameter to the method, if no parameters then we need to use data: "{}"

success: through this property when our [WebMethod] is Exccuted completely then success function will execute and return required data

error: This parameter is used to display the error message whenever we get an Exception.

Now Just Copy the Below Code and paste it in your Aspx page.

Before using this you must have to include the Namespace like

using System.Web.Services;

and Method is must Static with [WebMethod] Attribute


Fancy Slide Show of Image Gallery in JQuery Image slide show in Jquery

how to Disable Browser back button functionality using javascript Disable browser back button

Delete multiple record in gridview with checkbox selection Delete multiple record in gridview