Posts

Showing posts from September, 2013

C# Get All Files from Folder and Subfolders & Display it in Gridview in asp.net

Image
Introduction : Here I will explain how to get all files from folder and subfolders in C# and display or bind to Gridview in asp.net using C# , VB.NET  or  C# Get All Files from Folder and Subfolders and Display it in Gridview in asp.net . Description : In previous articles I explained Download files from gridview with link button in asp.net , Upload images to folder and display it in gridview in asp.net , create zip files in asp.net , Delete files from uploaded folder in asp.net , create/delete directory in asp.net , Joins in SQL Server and many articles relating to Gridview , SQL , jQuery , asp.net , C# , VB.NET . Now I will explain how to get all files from folder and subfolders and bind to Gridview in asp.net using C# , VB.NET . To display all files from folder and subfolders in Gridview we need to write the code like as shown below C# Code // Bind Data to Gridview protected void BindGridview() { string strpath = ...

jQuery Stop Form Submit on Enter Key or Disable Form Submission on Enter Key

Introduction :  Here I will explain how to stop form submit on enter in jQuery or prevent form submit on enter key in jQuery or disable form submission on enter key in jQuery . Description :    In previous articles I explained jQuery get current page url and title , jQuery disable future dates in datepicker , jQuery Get Cursor position , jQuery Bind double click event to button control , jQuery create rounded corners for textbox and many articles relating to JavaScript , jQuery , asp.net codesnippets . Now I will explain how to stop or disable form submission on enter key using jQuery . If you want to stop form submission we need to write the code like this $( function () { $( "form" ).submit( function (e) { event.preventDefault(); return false ; }); }) Suppose if we need to stop form submission on enter key need to write the code like as shown below Method 1 $( function ...

C# - Using Statement Example | Uses of Using Statement in C#

Introduction : In this article I will explain uses of using statement in c# and how to declare and use using statement in c# , vb.net , Asp.net . Description : In Previous posts I explained lot of articles regarding Asp.net , Gridview , SQL Server , Ajax , JavaScript etc . Now I will explain about using statement in c# . Generally in our applications we will write code like create connection object to handle connectionstring after that open a connection and create command object etc. to interact with database to get data that would be like this SqlConnection con = new SqlConnection (connectionString); con.Open(); SqlCommand cmd = new SqlCommand (commandString, con); cmd.ExecuteNonQuery(); con.Close(); It’s very easy way to write above code but problem is SqlConnection and SqlCommand objects will create IDISPOSABLE interface that means it could create unmanaged resources in our application to cleanup those objects we need to call D...

C# - Add/Copy Rows from One Datatable to Another Datatable

Introduction : Here I will explain simple code snippet in c# to add rows from one table to another table in vb.net , asp.net or copy rows from one datatable to another datatable in   c# , vb.net . Description : In Previous posts I explained using statement example in c# , Get all files from folder and subfolders in c# , Export webpage with images to pdf in asp.net and many articles relating to c# , vb.net , Asp.net , Gridview , SQL Server , Ajax , JavaScript etc . Now I will explain how to add rows from one table to another table in c# , vb.net , asp.net .   To add rows from one table to another table we need to use ImportRow function like as shown below C# Code DataTable _dt= new DataTable (); _dt = _ds.Tables[0]; DataTable dt1 = ds1.Tables[0]; for ( int i = 0; i < dt1.Rows.Count; i++) { _dt.ImportRow(dt1.Rows[i]); } VB.NET Code Dim _dt As New DataTable() _dt = _ds.Tables(0) Dim dt1 As ...

jQuery Wiki Plugin to Show Wikipedia Description in Tooltips

Image
Introduction : Here I will explain how to use jQuery wikiup plugin to show or display wikipedia description in tooltips or show Wikipedia information related to word or string using jQuery wikiup plugin . Description :    In previous articles I explained create simple tooltip with jQuery UI , show gridiview row details in tooltip on mouseover , jQuery Simple Slideshow example , jQuery image slideshow with text overlay , jQuery image slideshow with next and previous buttons and many articles relating to JavaScript , jQuery , asp.net . Now I will explain how to show Wikipedia information related to word or string using jQuery wikiup plugin . To implement this we need to write the code like as shown below < html xmlns ="http://www.w3.org/1999/xhtml"> < head > < title > jQuery plugin to show wikipedia description in tooltips </ title > < link href ="wikiUp.css" rel ="stylesheet" type =...