Skip to main content

Posts

Showing posts from July, 2011

Set height of page to full screen from JavaScript

Call any of the following JS method onload of body like to set the height of page to full screen. function resizehtml() {             window.moveTo(0, 0);             window.resizeTo(screen.availWidth, screen.availHeight);         } function setPanelHeight() {                         var hederHeight = document.getElementById('header').offsetHeight;             var footerHeight = document.getElementById('footer').offsetHeight;             var contentHeight = document.getElementById('content').offsetHeight;             height = document.body.clientHeight - hederHeight - footerHeight;             document.getElementById('content').style.height = height;             }

Custom Logger in ASP.NET along with access permission to folder

This class can be used to create custom logger in ASP.NET application which includes the functionality of giving the permissions to the log folder where seperate log file will be created for each day. using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Security.AccessControl; namespace MyNamespace.Logger {     public class Logger     {                public static void CreateLog(string strMessage,  string moduleName, bool isError)         {             try             {                 string strIsError = string.Empty;                 if (isError)                     strIsError = "Error:";                 else                     strIsError = "Information:";                 string fileUrl = GetFileUrl();                 string directoryName = System.IO.Path.GetDirectoryName(fileUrl);                 CreateFolder(directoryName);                 using (System.IO.StreamWriter sw = System.IO.File.AppendText(fileUrl))