Category: Dot Net Framework

How to get uploaded image dimensions in asp.net

How to get uploaded image dimensions in asp.net

I used following code to get uploaded image dimensions . Where flLogoUplaoded is name of asp .net file uploaded control at my application string UploadedImageType = flLogoUpload.PostedFile.ContentType.ToString().ToLower(); string UploadedImageFileName = flLogoUpload.PostedFile.FileName; //Create an image...

Saving and Restoring Form Location

Saving and Restoring Form Location

A common requirement for a form is to remember its last location. Usually, this information is stored in the registry. The code that follows shows a helper class that automatically stores information about a...

Session vs ViewState

Session vs ViewState

Session State is useful for storing values that must be persisted across multiple pages by the same user. ViewState is useful for storing serializable data that must be persisisted across PostBacks by a single...

URL Encoding in asp.net

URL Encoding in asp.net

One of way while transferring data from one page to other page is Querystring. But one problem is with Querystring is that many characters are not allowed in url.  So we must have to...

How to make better URI

How to make better URI

It should be as short as possible. Don’t sacrifice consistency or obviousness, but be brief. Organize and name things logically. ASP.NET isn’t always helpful in keeping a clean structure, so I highly recommend that...

How to write word document in asp.net

How to write word document in asp.net

You can add follwing code at page level function and called in button or page load function Void GenerateWordDoc() { string strDocBody; try { strDocBody = “<html “ + “xmlns:o=’urn:schemas-microsoft-com:office:office’ “ + “xmlns:w=’urn:schemas-microsoft-com:office:word’” +...

How to get Ip of Url in c#

How to get Ip of Url in c#

Here is sample code  remember to add system.net namespace IPHostEntry ip = Dns.GetHostByName (“www.yahoo.com”); IPAddress [] IpA = ipE.AddressList; for (int i = 0; i < IpA.Length; i++) {     Console.WriteLine (“IP Address {0}: {1}...

how to upload larger files in asp.net 2

how to upload larger files in asp.net 2

by default asp.net application did not upload file more than 4.5 mb or 4 mb. For this purpose You have to add following http runtime tag in web.cofig of web site. <httpRuntime executionTimeout=“90“ maxRequestLength=“20096“useFullyQualifiedRedirectUrl=“false“...