Posts

Showing posts from 2015

Gridview Header Checkbox Select and Deselect ALL Rows Checkbox

Import Jquery < script src ="jquery.min.js"></ script > Use this Code With in Head Tag: < script type ="text/javascript">         $(document).ready( function () {             $( '#chkselectall' ).click( function () {                 if ($( '#chkselectall' ).is( ':checked' )) {                     $( '[id$=testGrd]' ).find( 'input:checkbox' ).prop( 'checked' , true );                 }                 else {                     $( 'input:checkbox[name$=chkid]' ).each(                         function () {                             $( this ).removeAttr( 'checked' );                         });                 }             });         });             </ script > GridView: < table id ="ContentPlaceHolder1_testGrd"   cellspacing ="0" border ="1" >

Indian Rupee Font Symbol

Image
Rupee Font How to install font? 1.  Download  the font ITF-Rupee.ttf  2. Install the font. (It is easy. Just copy the font and paste it in "Fonts" folder in control panel) 3. Start Using Rupee Symbol.         

Automatically Clear Html Controls

        protected void AllTextBoxClear( Control c)         {             TextBox t = c as TextBox ;             if (t != null )             {                 string hi = t . Text = "" ;             }             foreach ( Control child in c . Controls)                 AllTextBoxClear(child);         }         protected void AllCheckBoxClear( Control c)         {             CheckBox t = c as CheckBox ;             if (t != null )             {                 t . Checked = false ;             }             foreach ( Control child in c . Controls)                 AllCheckBoxClear(child);         }

Install entity framework MVC

Image

[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'.

Image
Solution:       Add these line in Web.Config    < configSections >     < sectionGroup name =" system.web.webPages.razor " type =" System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 ">       < section name =" host " type =" System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 " requirePermission =" false " />       < section name =" pages " type =" System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 " requirePermission =" false " />     </ sectionGroup >   </ configSections >

How to Pass Datatable in Session C#

First assign datatable into Session.  Session[ "DT" ] = dt;  Response.Redirect( "Page2.aspx" ); In Page2.aspx page Load function call the thease Code to Get Session Table. DataTable dtm = ( DataTable )Session[ "DT" ];

Get Selected Checkbox Value from Gridview in Asp.net C#

In this Blog as Work with in gridview Selected Checkbox ID Value can Get In C#. ASPX Code:    < div style =" width : 104%; height : 243px; max-height : 243px; overflow : auto;">     < asp : GridView ShowHeader ="false" AutoGenerateColumns ="false"                       ID ="chklCategory" runat ="server">   < Columns >                                                                                     < asp : TemplateField >                                                                                         < ItemTemplate >      < asp : CheckBox runat ="server" AutoPostBack ="true" ID ="Checkbox_Category"   Text =' <% # bind("Name") %> ' />                                                                                               < asp : HiddenField runat ="server" ID ="hidCheck" Value

Display Jqplot Line Charts Data from Database

Image
     In this Section We See about Line Charts Using JqPlot. Jqplots provides Line. Pie Doughnut , Bar Charts for Freely.  Aspx Page: <% @ Page Language ="C#" AutoEventWireup ="true" CodeBehind ="jqplot.aspx.cs" Inherits ="BloggerCont.jqplot" %> <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server">     < title ></ title >     < script src ="jqplot/jquery.min.js" type ="text/javascript"></ script >     < link href ="jqplot/jquery.jqplot.css" rel ="stylesheet" type ="text/css" />     < script src ="jqplot/jquery.jqplot.js" type ="text/javascript"></ script >         < script type ="