Thursday, 26 June 2014





Description:

            In this example we explain that how to create Insert,Update,Delete in DataGrid View in C# window application. We already explain many example like insert update delete with paging and modal popup in web application. But in this example we explain that in how to perform CRUD operation in datagrid view in window application with C#.

To do this first you have to create one table in which you perform the operation.

And second main thing is that to perform Edit and Delete operation in datagrid view in window application is different from web Gridview. Here you have to create the dataGridView2_CellContentClick event like below

private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)

insert update delete in DataGridView in window application with C#





Description:

            In this example we explain that how to create Insert,Update,Delete in DataGrid View in C# window application. We already explain many example like insert update delete with paging and modal popup in web application. But in this example we explain that in how to perform CRUD operation in datagrid view in window application with C#.

To do this first you have to create one table in which you perform the operation.

And second main thing is that to perform Edit and Delete operation in datagrid view in window application is different from web Gridview. Here you have to create the dataGridView2_CellContentClick event like below

private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)

Tuesday, 24 June 2014





Description:-
I          
            In this example we explain that how to display childmenu item in all browser.
There are many question in your mind that

asp:menu does not display Child Menu items in IE 8

Does not show dynamic submenus of the Menu control in asp.net

Menu Control showing only Root Items, but no child items


That is the live problem that I have faced in my application that is in my application if we run our application in Internet Expoler 7 then submenu or Childmenu  will be displayed but  In other browser like mozila firefox and google chrome browser doesnot support this thing, so behind this reason we have to convert code in browser comp ability code so it will worked in all browser. So to do this you have to follow the following step like

à Create App_Browser Folder in Your Project.
à Right click on folder and add new item ‘Browser File’ and add it in your project.
à paste the following code in Browser File.


how to display child menuitem of asp:menu in asp.net





Description:-
I          
            In this example we explain that how to display childmenu item in all browser.
There are many question in your mind that

asp:menu does not display Child Menu items in IE 8

Does not show dynamic submenus of the Menu control in asp.net

Menu Control showing only Root Items, but no child items


That is the live problem that I have faced in my application that is in my application if we run our application in Internet Expoler 7 then submenu or Childmenu  will be displayed but  In other browser like mozila firefox and google chrome browser doesnot support this thing, so behind this reason we have to convert code in browser comp ability code so it will worked in all browser. So to do this you have to follow the following step like

à Create App_Browser Folder in Your Project.
à Right click on folder and add new item ‘Browser File’ and add it in your project.
à paste the following code in Browser File.


Monday, 23 June 2014






Description:-

In this example we explain that how to set RequireField Validator for Dropdownlist and Listbox in asp.net or how to validate dropdownlist and listbox in asp.net.

We all know that in any website and web application all developer must need to validate Dropdownlist and listbox in many web forms because of that is the basic requirement in any website.

The main point must keep in mind when you have to set RequireField validator for the Dropdownlist or Listbox is that you have to set InitialValue="0" property of the RequireField validator and in Dropdownlist put this line <asp:ListItem Value="0">--Select--</asp:ListItem>


 Create Nested Gridview in asp.Net Nested Gridview example

File Upload Example in MVC4 Upload File and bind to Gridview

Read/Write File in asp.net Read/write file using c#

how to set required field validator with DropDownList in Asp.Net






Description:-

In this example we explain that how to set RequireField Validator for Dropdownlist and Listbox in asp.net or how to validate dropdownlist and listbox in asp.net.

We all know that in any website and web application all developer must need to validate Dropdownlist and listbox in many web forms because of that is the basic requirement in any website.

The main point must keep in mind when you have to set RequireField validator for the Dropdownlist or Listbox is that you have to set InitialValue="0" property of the RequireField validator and in Dropdownlist put this line <asp:ListItem Value="0">--Select--</asp:ListItem>


 Create Nested Gridview in asp.Net Nested Gridview example

File Upload Example in MVC4 Upload File and bind to Gridview

Read/Write File in asp.net Read/write file using c#

Friday, 20 June 2014






Description:-

In this example we explain that how to bind Dropdownlist inside gridview or how to populate dropdownlist inside gridview ItemTemplate in asp.net.

Here in this example we have one table called employee and have two field like empname and country. When page is load the data of employyes table can be bind in gridview with empname in label and country is bind on the dropdownlist inside the gridview.

Here we define RowDatabound event of the gridview so one by one row of the gridview is binded with empname and it’s selected country and user can also change the employees country in the dropdownlist.

extract or convert unzip files to zip folder extract unzip files to zip file in asp.net

bind Accordion panel with dynamic data bind ajax accordion panel with dynamic data

how to bind data to Dropdownlist inside gridview in asp.net






Description:-

In this example we explain that how to bind Dropdownlist inside gridview or how to populate dropdownlist inside gridview ItemTemplate in asp.net.

Here in this example we have one table called employee and have two field like empname and country. When page is load the data of employyes table can be bind in gridview with empname in label and country is bind on the dropdownlist inside the gridview.

Here we define RowDatabound event of the gridview so one by one row of the gridview is binded with empname and it’s selected country and user can also change the employees country in the dropdownlist.

extract or convert unzip files to zip folder extract unzip files to zip file in asp.net

bind Accordion panel with dynamic data bind ajax accordion panel with dynamic data

Wednesday, 18 June 2014




 

Description:-

 

In this example I explain that how to Pass values of checkBox to controller action method in asp.net mvc4 or Get checkbox values in controller mvc 4.

 

In previous example we already explain that How to Bind checkboxlist in mvc but now how to pass checked checkbox value to controller action method. To do this first you create the table tblcity with three column like id, name, isselected and insert data in this table.


to sorting data in gridview with up and down arrow sorting data in gridview in asp.net


change the background of gridview row when mouse is hover changebackground color of gridview in asp.net

 

Here in this example we implement that checkboxes with city and When a user selects one or more cities(checkbox) and click on Submit button, then  selected cities(checkbox) should be displayed in a webpage.

 

Pass values of checkBox to controller action in asp.net mvc4




 

Description:-

 

In this example I explain that how to Pass values of checkBox to controller action method in asp.net mvc4 or Get checkbox values in controller mvc 4.

 

In previous example we already explain that How to Bind checkboxlist in mvc but now how to pass checked checkbox value to controller action method. To do this first you create the table tblcity with three column like id, name, isselected and insert data in this table.


to sorting data in gridview with up and down arrow sorting data in gridview in asp.net


change the background of gridview row when mouse is hover changebackground color of gridview in asp.net

 

Here in this example we implement that checkboxes with city and When a user selects one or more cities(checkbox) and click on Submit button, then  selected cities(checkbox) should be displayed in a webpage.

 

This entry was posted in :

Tuesday, 17 June 2014




Description:-

            In this Example I explain that How to Bind Data to Checkbox List from sqlserver database or Create Checkbox list in mvc4 or how to Implement or use checkbox in MVC4. We already explain that How to Bind Checkbox list in asp.Net but in MVC that is different way to Bind Checkbox list.


how to upload image in database have a datatype is Image upload image with image datatype


How to create or generate Captcha code in asp.net captcha code same like Google in asp.net

Here we create a model class Category with three properties with name like id, name and selected  and one static method that will return the List of all Category.

How to create a CheckboxList in MVC4




Description:-

            In this Example I explain that How to Bind Data to Checkbox List from sqlserver database or Create Checkbox list in mvc4 or how to Implement or use checkbox in MVC4. We already explain that How to Bind Checkbox list in asp.Net but in MVC that is different way to Bind Checkbox list.


how to upload image in database have a datatype is Image upload image with image datatype


How to create or generate Captcha code in asp.net captcha code same like Google in asp.net

Here we create a model class Category with three properties with name like id, name and selected  and one static method that will return the List of all Category.
This entry was posted in :

Sunday, 15 June 2014









Description:-
In this Example I explain that how to Disable Right click or Prevent right click on your webpage or Document.

As a web developer we always want something different like disabling mouse button right clicks. Or disable cut copy facility  etc.. for some security purpose.

This is simply thing that disable right click on the webpage by simply add one line of code in <body> tag like
<body oncontextmenu="return false">
...
</body>
Or by using javascript like
<script language="javascript">
document.onmousedown=disableclick;
status="Right Click Disabled";
Function disableclick(event)
{
  if(event.button==2)
   {
     alert(status);
     return false;   
   }
}
</script>


Disable Right Click On Web Page Using Javascript









Description:-
In this Example I explain that how to Disable Right click or Prevent right click on your webpage or Document.

As a web developer we always want something different like disabling mouse button right clicks. Or disable cut copy facility  etc.. for some security purpose.

This is simply thing that disable right click on the webpage by simply add one line of code in <body> tag like
<body oncontextmenu="return false">
...
</body>
Or by using javascript like
<script language="javascript">
document.onmousedown=disableclick;
status="Right Click Disabled";
Function disableclick(event)
{
  if(event.button==2)
   {
     alert(status);
     return false;   
   }
}
</script>


Wednesday, 11 June 2014






Description:-

How to send user confirmation email after registration is complete in your website then Activation link is send to the user email to verify the user in ASP.Net using C# .Net.

also to validate the email Id of the user enter during registration fill up form, a confirmation email with activation link is sent to the email address as user enter in Registration and when user clicks on the Activation  link, his email address is verified and his account gets activated or started.

We all know very well today every website have this Email verification process to exclude the dummy user or for better security.

In this example we will explain that how to send user confirmation email after registration with Activation link in ASP.Net using C# .Net.

How to Send user Confirmation email after Registration with Activation Link in ASP.Net






Description:-

How to send user confirmation email after registration is complete in your website then Activation link is send to the user email to verify the user in ASP.Net using C# .Net.

also to validate the email Id of the user enter during registration fill up form, a confirmation email with activation link is sent to the email address as user enter in Registration and when user clicks on the Activation  link, his email address is verified and his account gets activated or started.

We all know very well today every website have this Email verification process to exclude the dummy user or for better security.

In this example we will explain that how to send user confirmation email after registration with Activation link in ASP.Net using C# .Net.

Tuesday, 10 June 2014





Description:-

 in this Example we explain that how to pass String Array as a Parameter in Sql Query Dynamically or pass String Array as a Parameter to be used in Sql Query using the “IN” command.

In my application that is a security is that if Admin login then Admin is Exists in all type of ACL so Admin can show all the reports and do some changes. But when other user is login then we have to first check the List of the ACL in which user are Exists and then display only those reports that are related to ACl.

For Example :- there are two ACL Account and IT/Software then user xyz have exists in Account ACL then when xyz user is login then only Account related reports are shown IT/software report are not show.

This is the real problem I have faced in my life is that I want to pass the List of ACL to sql query Dynamicaly as a string array and I want to fetch the type of reports that ACL name is same as the we pass as a string array so user can display only those reports that type is equals to those ACL contain.

Syntax:-

StringBuilder query = new StringBuilder("Select * from Employee where emp_name in (");
for (int i = 0; i < empNames.length; i++) {
  if (i > 0) {
    query.append(",");
  }
  query.append(empNames[i].toString());
}

query.append(")");

to show Example of How to Create a Paging in DataList click here Paging in DataList

to show Example of How to Export Gridview Data to PDF File Export Gridview Rows to PDF file


How to pass array of strings dynamically to SQL “IN” clause in Asp.Net





Description:-

 in this Example we explain that how to pass String Array as a Parameter in Sql Query Dynamically or pass String Array as a Parameter to be used in Sql Query using the “IN” command.

In my application that is a security is that if Admin login then Admin is Exists in all type of ACL so Admin can show all the reports and do some changes. But when other user is login then we have to first check the List of the ACL in which user are Exists and then display only those reports that are related to ACl.

For Example :- there are two ACL Account and IT/Software then user xyz have exists in Account ACL then when xyz user is login then only Account related reports are shown IT/software report are not show.

This is the real problem I have faced in my life is that I want to pass the List of ACL to sql query Dynamicaly as a string array and I want to fetch the type of reports that ACL name is same as the we pass as a string array so user can display only those reports that type is equals to those ACL contain.

Syntax:-

StringBuilder query = new StringBuilder("Select * from Employee where emp_name in (");
for (int i = 0; i < empNames.length; i++) {
  if (i > 0) {
    query.append(",");
  }
  query.append(empNames[i].toString());
}

query.append(")");

to show Example of How to Create a Paging in DataList click here Paging in DataList

to show Example of How to Export Gridview Data to PDF File Export Gridview Rows to PDF file





Description:-

In this example we explain that Create Radio button List from the Model in MVC or how to create or bind Radiobutton in mvc or asp.net with mvc razor view.

This is very useful when create a quiz page or online exam aplication where we are going to show some questions with it’s answers to the user and user can select an answer from the available answer options, represented by radio buttons.

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



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

Let’s suppose that we have a Model for the tbl_hobby and we want to render a radio button list for all hobby. Then Take the following model as an example.

public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
           
            _dbcontext = new HobbyEntities();
           // var list = new _dbcontext.tbl_Employee>
            var model = _dbcontext.tbl_hobby;
            return View(model.ToList<tbl_hobby>());
           
        }

How to bind radio button with model data ASP.Net MVC




Description:-

In this example we explain that Create Radio button List from the Model in MVC or how to create or bind Radiobutton in mvc or asp.net with mvc razor view.

This is very useful when create a quiz page or online exam aplication where we are going to show some questions with it’s answers to the user and user can select an answer from the available answer options, represented by radio buttons.

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



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

Let’s suppose that we have a Model for the tbl_hobby and we want to render a radio button list for all hobby. Then Take the following model as an example.

public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
           
            _dbcontext = new HobbyEntities();
           // var list = new _dbcontext.tbl_Employee>
            var model = _dbcontext.tbl_hobby;
            return View(model.ToList<tbl_hobby>());
           
        }

This entry was posted in :

Friday, 6 June 2014




 Description:-

In this example we explain that how to Filtering records in WebGrid using dropdownlist in MVC or search record in Gridview based on Dropdown Selection.this post contains a dropdownlist with all country  names and a webgrid that will contain student’s details including their country that will be changed on the dropdownlist  selection change.

So when user select country India from dropdownlist then all record are bind into webgrid that country are India same as if user select country Pakistan from dropdown then all record of Pakistan country are bind into the webgrid.

Here we use Partial view for webgrid when dropdown change by user then partial view for student webgrid are showing with data.

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


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

Filtering records in WebGrid using dropdownlist in MVC4




 Description:-

In this example we explain that how to Filtering records in WebGrid using dropdownlist in MVC or search record in Gridview based on Dropdown Selection.this post contains a dropdownlist with all country  names and a webgrid that will contain student’s details including their country that will be changed on the dropdownlist  selection change.

So when user select country India from dropdownlist then all record are bind into webgrid that country are India same as if user select country Pakistan from dropdown then all record of Pakistan country are bind into the webgrid.

Here we use Partial view for webgrid when dropdown change by user then partial view for student webgrid are showing with data.

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


How to upload File and Fetch file from SqlServer and bind to Gridview fetch file from Sqlserver and bind to Gridview
This entry was posted in :

Thursday, 5 June 2014





Description:-

            In this example I explain that how to Showing and hiding details in a datagrid row in asp.net.


DataGrid is an ASP.NET server side control  to display data in a tabular format with options of choice, sorting, and editing entries.it is same like Gridview control to manipulate data in tabular format.

In this example we use XML file in which data are stored and we are bind XML data to DataGrid control.in Datagrid we provide to link for each and every rows to show and Hide the details of the record. When user click on show details then prize coloumn of Datagrid will be shown and click on hide link then it will be hide the prize coloumn.

Dynamically Bind data in Ajax Accordion Panel Ajax Accordion panel Example in asp.net

how to Restrict the size of file upload when upload by user restrict the size of file upload control in asp.net

Showing and hiding details in a datagrid row in asp.net





Description:-

            In this example I explain that how to Showing and hiding details in a datagrid row in asp.net.


DataGrid is an ASP.NET server side control  to display data in a tabular format with options of choice, sorting, and editing entries.it is same like Gridview control to manipulate data in tabular format.

In this example we use XML file in which data are stored and we are bind XML data to DataGrid control.in Datagrid we provide to link for each and every rows to show and Hide the details of the record. When user click on show details then prize coloumn of Datagrid will be shown and click on hide link then it will be hide the prize coloumn.

Dynamically Bind data in Ajax Accordion Panel Ajax Accordion panel Example in asp.net

how to Restrict the size of file upload when upload by user restrict the size of file upload control in asp.net