ViewBag – ViewData – TempData objects
August 11, 2011 by taxi · Leave a Comment
All of them are properties of Controllers and Views, and all of them are used to transport very sm
Import Google Contacts – ASP.NET
January 27, 2011 by taxi · Leave a Comment
How can we download our google address book to some local DB, file etc? One of the coolest things google has provided for developers is the Google Data API for integration of user and google applications. And for importing google contacts, firstly we need to download Google Data API and install them to get the [...]
Cloud Computing – ASP.NET
January 26, 2011 by Nauman · Leave a Comment
Following are some of pros and cons for Cloud Computing Architecture for ASP.NET: Advantages: Cost cutting More storage for Data. Mobilitiy of Data Easy Disaster Recovery Disadvantages Implementation of session Implementation of authentication Migration of existing application
Multiple Web.Config in Visual Studio 2010
December 23, 2010 by Nauman · Leave a Comment
Previously it was a very difficult job to have configuration files for different application environments, like having config files for devel
Retrieving domain information through ASP.NET
December 24, 2009 by Nauman · Leave a Comment
There are many domain checking websites available that gives all the information regarding domains. WhoIs is one of them. Following is a sample asp.net code that connects to one of WhoIs servers and retrieve information of a specific website. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Net.Sockets; using System.IO; [...]
Add meta data dynamically
Add meta-data dynamically to your page by adding a HtmlMeta control to your Header. In this example I dynamically add a keyword string to the page. string keyWords = “metatags, html, dynamic, generate”; HtmlMeta keywords = new HtmlMeta(); keywords.Name = “keywords”; keywords.Content = keyWords; Page.Header.Controls.Add(keywords);
Date Time string formatting in ASP.NET
With the following code you can format a DateTime within a Databind. <%# DateTime.Parse(Eval("DateModified").ToString()).ToString("MM-dd-yyyy")%> Some more format specifiers that can change format of datetime objects the way it is required. Format specifier Name d Short date pattern D Long date pattern t Short time pattern T Long time pattern f Full date/time pattern ( short [...]
Easy way to Export dataset in Excel
November 5, 2009 by Nauman · Leave a Comment
Fastest way to export dataset in excel format is: DataSet dsExport = new DataSet(); System.IO.StringWriter tw = new System.IO.StringWriter(); HTMLTextWriter hw = new HTMLTextWriter(tw); DataGrid dg = new DataGrid(); dg.DataSource = "Dataset to be exported" hw.WriteLine ("<b><font size=’3′>Exported report</font></b>"); dg.DataBind(); Response.ContentType = "application/vnd.ms-excel"; EnableViewState = false; Response.Write(tw.ToString()); Response.End();
Crystal Report Viewer width – Visual Studio
November 5, 2009 by Nauman · Leave a Comment
By default Crystal report viewer width is fixed according to it toolbar, but changes due to amount of data present in the report. And the width is not editable (as it is seen). Because of this reason if a crystal report has good amount of data then it goes past page width and disturbs the [...]
MS Charts in Visual Studion 2008
November 5, 2009 by Nauman · Leave a Comment
Looking for some good looking and lightweight charting control to be used with VS 2008 applications. I have checked the following article on adding an using MS Charts control in vs 2008. It contains all the basic information regarding the creation and implementation of ms chart controls. MS Charts MS Charts Download Chart Templates