Sunday, 2 December 2012

Freeze column in html table

<html>
<head>
    <title></title>
    <style>
        table
        {
            font-family: verdana;
        }
        div#AdjResultsDiv
        {
            width: 200px;
            height: 200px;
            overflow-x: scroll;
            position: relative;
            font-family: verdana;
        }
        div#AdjResultsDiv th
        {
            background-color: navy;
            font-family: verdana;
            color: white;
            position: relative;
            cursor: default;
            top: expression(document.getElementById("AdjResultsDiv").scrollTop-2); /*IE5+ only*/
            z-index: 10;
        }
        td.locked, th.locked
        {
            font-family: verdana;
            color: white;
            background-color: navy;
            position: relative;
            cursor: default;
            left: expression(document.getElementById("AdjResultsDiv").scrollLeft-2); /*IE5+ only*/
        }
        div#AdjResultsDiv th.locked, div#AdjResultsDiv td.normal
        {
            z-index: 99;
        }
    </style>
</head>
<body>
    <div id="AdjResultsDiv">
        <table border="1" style="left: 1px; top: 155px; height: 1px;" cellpadding="0px" cellspacing="0px"
            align="center">
            <tr>
                <td class="locked" style="font-weight: bold; font-size: 12px; background-color: #69a6d0;
                    font-size: 12px; color: #ffffff; height: 19px; color: White;" width="100px" align="center">
                    Colunm1
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm2
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="250px" align="center">
                    Colunm3
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm4
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm5
                </td>
            </tr>
            <tr>
                <td class="locked" style="font-weight: bold; font-size: 12px; background-color: #69a6d0;
                    font-size: 12px; color: #ffffff; height: 19px; color: White;" width="100px" align="center">
                    Colunm1
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm2
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="250px" align="center">
                    Colunm3
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm4
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm5
                </td>
            </tr>
            <tr>
                <td class="locked" style="font-weight: bold; font-size: 12px; background-color: #69a6d0;
                    font-size: 12px; color: #ffffff; height: 19px; color: White;" width="100px" align="center">
                    Colunm1
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm2
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="250px" align="center">
                    Colunm3
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm4
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm5
                </td>
            </tr>
            <tr>
                <td class="locked" style="font-weight: bold; font-size: 12px; background-color: #69a6d0;
                    font-size: 12px; color: #ffffff; height: 19px; color: White;" width="100px" align="center">
                    Colunm1
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm2
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="250px" align="center">
                    Colunm3
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm4
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm5
                </td>
            </tr>
            <tr>
                <td class="locked" style="font-weight: bold; font-size: 12px; background-color: #69a6d0;
                    font-size: 12px; color: #ffffff; height: 19px; color: White;" width="100px" align="center">
                    Colunm1
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm2
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="250px" align="center">
                    Colunm3
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm4
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm5
                </td>
            </tr>
            <tr>
                <td class="locked" style="font-weight: bold; font-size: 12px; background-color: #69a6d0;
                    font-size: 12px; color: #ffffff; height: 19px; color: White;" width="100px" align="center">
                    Colunm1
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm2
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="250px" align="center">
                    Colunm3
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm4
                </td>
                <td style="font-weight: bold; font-size: 12px; color: #ffffff; height: 19px; background-color: #69a6d0;
                    color: White;" width="100px" align="center">
                    Colunm5
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

write error message in Notepad using C#


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Net.Mail;
using System.Net;

public partial class ErrorMessageInNotePad : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnCreateError_Click(object sender, EventArgs e)
    {
        try
        {
            throw new System.ArgumentException("Sajil Created the ErrorMessage!!!");
        }
        catch (Exception ex)
        {
//HERE YOU CAN USE PAGE NAME,FILE NAME,MODULE NAME OR FUNCTION                                               NAME TO   IDENTIFY THE ERROR SPOT  AND YOU CAN ALSO MAKE THESE CODE AS SAPARATE FUNCTION  AND USE IN CACTH BLOCK.

            StreamWriter sw = new StreamWriter(Server.MapPath("ErrorNotepad") + "\\ErrorList.txt", true);
            sw.WriteLine("Error occurred at", DateTime.Now.ToString());
            sw.WriteLine(ex.Message, DateTime.Now.ToString());
            sw.Dispose();
//CODE FOR SEND MAIL THAT NOTEPAD
            MailMessage newmsg;
            MailAddress mailfrom = new MailAddress("xxxxx.com");
            MailAddress mailto = new MailAddress("xxxxx.com");
            newmsg = new MailMessage(mailfrom, mailto);

            newmsg.Body ="You Have Error Message!!!";
         
            Attachment att = new Attachment(Server.MapPath("ErrorNotepad") + "\\ErrorList.txt");

            newmsg.Attachments.Add(att);
            SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
            smtp.UseDefaultCredentials = false;
            smtp.Credentials = new NetworkCredential("xxxxx", "xxxxx");
            smtp.EnableSsl = true;
            smtp.Send(newmsg);
           

        }
    }
}
POST COMMENT IF ITS USEFULL,HAPPY CODING.....