Posts

Showing posts from June, 2012

Get all files of directory and sub directories

public   void   GetFiles( ) {                 string Paths = "C:\\Test\\" ;                 Hashtable htResult = new Hashtable ();                                              // get files                 string [] fileEntries = Directory .GetFiles(Paths);                 ArrayList files = new ArrayList ();                         ...

Ajax Modal Popup Extender

In aspx: Add following code < AjaxControlToolkit : ModalPopupExtender ID ="popupid" runat ="server" TargetControlID ="controlid" PopupControlID =" popupcontrolid" DropShadow ="True" BackgroundCssClass ="cssclass" DynamicServicePath ="" Enabled ="True"> </ AjaxControlToolkit : ModalPopupExtender > TargetControlID is control id like Textbox, Checkbox, Imagebutton. On click of this popup fires. control id can be in mode visible=false and we can trigger the popup by calling show() function in codebehind but if we didn’t given that targetcontrolid to ModalPopupExtender it will throw error PopupControlID is Popupcontrol like panel to be displayed on click of targetcontrolid. Eg.: < asp : ImageButton ID ="imbworkordermachinesearch" runat ="server" Style =" vertical-align : bottom ; "   ImageUrl ="~/Images/search.gif" /...

How to create a Pie chart using ASP.Net and C#

First Step: Web Config file The Web.Config file needs to be modified to contain the httpHandler and controls . These configurations enable the asp:Chart tag which is used in the Default.aspx file. In httpHandlers add below code: <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral,  PublicKeyToken=31bf3856ad364e35" /> In controls add below code: <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> Second Step:  Default.aspx file: we will add the chart, titles, legend, series and chart areas. <asp:Chart ID="Chart1" runat="server" Width="500px"  Height="500px" I...

Error in Datagrid View Design : Line Disappear between the coulumn fields

In aspx:  add CellPadding="0" <asp:GridView ID="dtgDownTimeMonthly" runat="server" CellPadding="0">   </asp:GridView>