Sunday, February 5, 2017

Media query

(Shamelessly copying the content as-is)

https://msdn.microsoft.com/en-us/library/ms534161(v=vs.85).aspx

Property values

Type: String
all
Default. Applies to all devices.
print
Output is intended for printed material and for on-screen documents viewed in Print Preview mode.
screen
Output is intended for computer screens.
tv
Output is intended for television screens.
unknown
Intended output is unknown.
aural
Output is intended for speech synthesizers.
braille
Output is intended for braille tactile feedback devices.
embossed
Intended output is embossed.
handheld
Output is intended for handheld devices.
projection
Output is intended for projection devices.
tty
Output is intended for TTY devices

Bootstrap container vs container-fluid

I am Lazy :-)  Just copy & paste from Bootstrap official website.. he he he..


Containers

Bootstrap requires a containing element to wrap site contents and house our grid system. You may choose one of two containers to use in your projects. Note that, due to padding and more, neither container is nestable.
Use .container for a responsive fixed width container.
Copy
class="container"> ...
Use .container-fluid for a full width container, spanning the entire width of your viewport.
Copy
class="container-fluid"> ...

Bootstrap - col-[xs/sm/md/lg]


I always get confused if we need to specify col-xs, col-sm, col-md and col-lg classes for a column in bootstrap. If we specify col-xs it gets applied to xs, sm, md and lg unless we have different value for sm, md and lg. 

http://getbootstrap.com/css/ 

Introduction:
  • Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, e.g. applying any .col-md-* class to an element will not only affect its styling on medium devices but also on large devices if a .col-lg-* class is not present.




Monday, April 25, 2016

Visual Studio 2015

At last.. after several years of gap, I am into blogging again.  What was I doing all these years, doing same job, same work :-)


Started using visual studio 2015 and I am all smileys all day :-)

Certain minimum things we should be aware of :

1. BOWER
2. Nuget packages







Wednesday, June 26, 2013

sql server stuff

CREATE TABLE EMPLOYEE ( EMPID INT IDENTITY(1,1), EMPNAME VARCHAR(500) ) ALTER TABLE EMPLOYEE ADD CONSTRAINT PK_EMPLOYEE_EMPID PRIMARY KEY (EMPID) ALTER TABLE EMPLOYEE ALTER COLUMN EMPNAME VARCHAR(501) CREATE INDEX IX_EMPLOYEE_EMPNAME ON EMPLOYEE (EMPNAME)

Friday, January 20, 2012

Exception handling difference between .NET Framework 1.1 and 2.0

What happens if there is an application exception thrown and is not caught by application.

In .NET framework 1.1, it impacts the current application (web or windows)

In .NET Framework 2.0, it goes upto worker process (beyond our current application), and after a couple of uncaught exceptions, the Website will be stopped automatically (Dangerous !!).

Tuesday, March 15, 2011

Serialize a class to XML

public string GetXML()
{
XmlSerializer objXMLSerializer = null;
StringWriter objStrW = null; // String writer to serialize the object to xml
String strXML; // Stores the serialized XML string
try
{
//Initilize the serializer
objXMLSerializer = new XmlSerializer(this.GetType()); // The serializer object
// Serialize the object
objStrW = new StringWriter();
objXMLSerializer.Serialize(objStrW, this);
// Retrieve the XML
strXML = objStrW.ToString().Replace(CommonConstants.CONST_UTF16, CommonConstants.CONST_UTF8);
return strXML;
}
catch (Exception ex)
{
//throw the exception to the calling function
throw ex;
}
finally
{
//Release the objects
objStrW.Close();
objXMLSerializer = null;
}
}

Wednesday, July 28, 2010

Stored Procedures Performance Tuning

Recently I was given to optimize an SQL Query & would like to post my experience on that.


Indexes : Indexes are the only best way to improve the performance of select query.

Even though we have indexes, we might not be using them properly. For example, if the select statement has a where condition, we have to check if all the columns in where clause have an index. 
Even if one column doesn't have an index, that causes lot of performance degradation. We can even have index on more than one column. Even this helps some times... (covered index - when all the columns in select query have an index, its called covered index)


SQL server has an option even to specify which index we can use when one column has more than one index on it, one for the column alone , one could be on a group of columns.


2. In the where clause if there is any aggregation - for ex: if you have convert(varchar,date1,101) in where clause - then the Index on date1 field doesn't work even though there is an index on it.

Never use functions in the where clause - this causes lot of performance degradation.


Friday, March 20, 2009

Regular Expressions















Regular Expressions

CharacterDefinition
^Start of a string.
$End of a string.
.Any character (except \n newline)
|Alternation.
{...}Explicit quantifier notation.
[...]Explicit set of characters to match.
(...)Logical grouping of part of an expression.
*0 or more of previous expression.
+1 or more of previous expression.
?0 or 1 of previous expression; also forces minimal matching when an expression might match several strings within a search string.
\Preceding one of the above, it makes it a literal instead of a special character. Preceding a special matching character, see below.

















Character Classes http://tinyurl.com/5ck4ll

Char ClassDescription
.Matches any character except \n. If modified by the Singleline option, a period character matches any character. For more information, see Regular Expression Options.
[aeiou]Matches any single character included in the specified set of characters.
[^aeiou]Matches any single character not in the specified set of characters.
[0-9a-fA-F]Use of a hyphen (–) allows specification of contiguous character ranges.
\p{name}Matches any character in the named character class specified by {name}. Supported names are Unicode groups and block ranges. For example, Ll, Nd, Z, IsGreek, IsBoxDrawing.
\P{name}Matches text not included in groups and block ranges specified in {name}.
\wMatches any word character. Equivalent to the Unicode character categories
[\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}\p{Pc}]. If ECMAScript-compliant behavior is specified with the ECMAScript option, \w is equivalent to [a-zA-Z_0-9].
\WMatches any nonword character. Equivalent to the Unicode categories [^\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}\p{Pc}]. If ECMAScript-compliant behavior is specified with the ECMAScript option, \W is equivalent to [^a-zA-Z_0-9].
\sMatches any white-space character. Equivalent to the Unicode character categories [\f\n\r\t\v\x85\p{Z}]. If ECMAScript-compliant behavior is specified with the ECMAScript option, \s is equivalent to [ \f\n\r\t\v].
\SMatches any non-white-space character. Equivalent to the Unicode character categories [^\f\n\r\t\v\x85\p{Z}]. If ECMAScript-compliant behavior is specified with the ECMAScript option, \S is equivalent to [^ \f\n\r\t\v].
\dMatches any decimal digit. Equivalent to \p{Nd} for Unicode and [0-9] for non-Unicode, ECMAScript behavior.
\DMatches any nondigit. Equivalent to \P{Nd} for Unicode and [^0-9] for non-Unicode, ECMAScript behavior.

Monday, February 23, 2009

Custom Validator to validate Date

This is a custom validation that tests if the given date is in 30 days from today. (This validator throws error when the date is less than today or when the date is greater than 30 days from today)

--------------------------------------------------------------------------------------
This post is purely for my personal reference. :-)
-----------------------------------------------------------------------------------------


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
function datevalidate(sender, args)
{
var dd = document.getElementById("<%=TextBox1.ClientID%>").value;
var mm = document.getElementById("<%=TextBox2.ClientID%>").value;
var yy = document.getElementById("<%=TextBox3.ClientID%>").value;
//Why can't I take date from Javascript ? (I want server's date as per my requirement)
var ddnow = document.getElementById("<%=hdnDay.ClientID%>").value;
var mmnow = document.getElementById("<%=hdnMonth.ClientID%>").value;
var yynow = document.getElementById("<%=hdnYear.ClientID%>").value;
mm = mm-1; // javascript month range 0 - 11
mmnow = mmnow-1; //Month ranges from 0-11 in Javascript
var tempDate = new Date(yy,mm,dd);
var today = new Date(2009,1,23);
var d = new Date();
d.setFullYear(yynow,mmnow,ddnow+30);
//First check if the given date is valid.
if ( (yy == tempDate.getFullYear()) && (mm == tempDate.getMonth()) && (dd == tempDate.getDate()) )
{
if(tempDate < today)
{
args.IsValid = false;
}
else
{
if(tempDate < d)
args.IsValid = true;
else
args.IsValid = false;
}
}
// if ( (yy == tempDate.getFullYear()) && (mm == tempDate.getMonth()) && (dd == tempDate.getDate()) )
// {
// args.IsValid=true;
// } else
// {
// args.IsValid=false;
// }
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:textbox id="TextBox1" runat="server"></asp:TextBox>
<asp:textbox id="TextBox2" runat="server"></asp:TextBox>
<asp:textbox id="TextBox3" runat="server"></asp:TextBox>
<asp:customvalidator id="custdate" runat="server" controltovalidate="TextBox3" clientvalidationfunction="datevalidate" errormessage="Invalid date"></asp:CustomValidator>
<br />
<asp:button id="Button1" runat="server" text="Button">
<input type="hidden" id="hdnDay" runat="server">
<input type="hidden" id="hdnMonth" runat="server">
<input type="hidden" id="hdnYear" runat="server">
</div>
</form>
</body>
</html>


-----------------------------------------------------------------
Code-behind
-----------------------------------------------------------------


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
hdnDay.Value = DateTime.Now.ToString("dd");
hdnMonth.Value = DateTime.Now.ToString("MM"); //m is for minutes. M is for month.
hdnYear.Value = DateTime.Now.ToString("yyyy");
}
}

Thursday, November 27, 2008

Printing Date in different formats

DateTime.ToString()
Assume dt is a datetime object.
dt.ToString("MM/dd/yyyy") prints 05/05/2005
In the same way, try out the following options.

0 MM/dd/yyyy 05/05/2005
1 dddd, dd MMMM yyyy Thursday, 05 May 2005
2 dddd, dd MMMM yyyy HH:mm Thursday, 05 May 2005 06:30
3 dddd, dd MMMM yyyy hh:mm tt Thursday, 05 May 2005 06:30 AM
4 dddd, dd MMMM yyyy H:mm Thursday, 05 May 2005 6:30
5 dddd, dd MMMM yyyy h:mm tt Thursday, 05 May 2005 6:30 AM
6 dddd, dd MMMM yyyy HH:mm:ss Thursday, 05 May 2005 06:30:07
7 MM/dd/yyyy HH:mm 05/05/2005 06:30
8 MM/dd/yyyy hh:mm tt 05/05/2005 06:30 AM
9 MM/dd/yyyy H:mm 05/05/2005 6:30
10 MM/dd/yyyy h:mm tt 05/05/2005 6:30 AM
10 MM/dd/yyyy h:mm tt 05/05/2005 6:30 AM
10 MM/dd/yyyy h:mm tt 05/05/2005 6:30 AM
11 MM/dd/yyyy HH:mm:ss 05/05/2005 06:30:07
12 MMMM dd May 05
13 MMMM dd May 05
14 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2005-05-05T06:30:07.7199222-04:00
15 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2005-05-05T06:30:07.7199222-04:00
16 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Thu, 05 May 2005 06:30:07 GMT
17 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Thu, 05 May 2005 06:30:07 GMT
18 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2005-05-05T06:30:07
19 HH:mm 06:30
20 hh:mm tt 06:30 AM
21 H:mm 6:30
22 h:mm tt 6:30 AM
23 HH:mm:ss 06:30:07
24 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2005-05-05 06:30:07Z
25 dddd, dd MMMM yyyy HH:mm:ss Thursday, 05 May 2005 06:30:07
26 yyyy MMMM 2005 May
27 yyyy MMMM 2005 May

The patterns for DateTime.ToString ( 'd' ) :
0 MM/dd/yyyy 05/05/2005

The patterns for DateTime.ToString ( 'D' ) :
0 dddd, dd MMMM yyyy Thursday, 05 May 2005

The patterns for DateTime.ToString ( 'f' ) :
0 dddd, dd MMMM yyyy HH:mm Thursday, 05 May 2005 06:30
1 dddd, dd MMMM yyyy hh:mm tt Thursday, 05 May 2005 06:30 AM
2 dddd, dd MMMM yyyy H:mm Thursday, 05 May 2005 6:30
3 dddd, dd MMMM yyyy h:mm tt Thursday, 05 May 2005 6:30 AM

The patterns for DateTime.ToString ( 'F' ) :
0 dddd, dd MMMM yyyy HH:mm:ss Thursday, 05 May 2005 06:30:07

The patterns for DateTime.ToString ( 'g' ) :
0 MM/dd/yyyy HH:mm 05/05/2005 06:30
1 MM/dd/yyyy hh:mm tt 05/05/2005 06:30 AM
2 MM/dd/yyyy H:mm 05/05/2005 6:30
3 MM/dd/yyyy h:mm tt 05/05/2005 6:30 AM

The patterns for DateTime.ToString ( 'G' ) :
0 MM/dd/yyyy HH:mm:ss 05/05/2005 06:30:07

The patterns for DateTime.ToString ( 'm' ) :
0 MMMM dd May 05

The patterns for DateTime.ToString ( 'r' ) :
0 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Thu, 05 May 2005 06:30:07 GMT

The patterns for DateTime.ToString ( 's' ) :
0 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2005-05-05T06:30:07

The patterns for DateTime.ToString ( 'u' ) :
0 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2005-05-05 06:30:07Z

The patterns for DateTime.ToString ( 'U' ) :
0 dddd, dd MMMM yyyy HH:mm:ss Thursday, 05 May 2005 06:30:07

The patterns for DateTime.ToString ( 'y' ) :
0 yyyy MMMM 2005 May

Building a custom DateTime.ToString Patterns
The following details the meaning of each pattern character. Not the K and z character.

d Represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero
dd Represents the day of the month as a number from 01 through 31. A single-digit day is formatted with a leading zero
ddd Represents the abbreviated name of the day of the week (Mon, Tues, Wed etc)
dddd Represents the full name of the day of the week (Monday, Tuesday etc)
h 12-hour clock hour (e.g. 7)
hh 12-hour clock, with a leading 0 (e.g. 07)
H 24-hour clock hour (e.g. 19)
HH 24-hour clock hour, with a leading 0 (e.g. 19)
m Minutes
mm Minutes with a leading zero
M Month number
MM Month number with leading zero
MMM Abbreviated Month Name (e.g. Dec)
MMMM Full month name (e.g. December)
s Seconds
ss Seconds with leading zero
t Abbreviated AM / PM (e.g. A or P)
tt AM / PM (e.g. AM or PM
y Year, no leading zero (e.g. 2001 would be 1)
yy Year, leadin zero (e.g. 2001 would be 01)
yyy Year, (e.g. 2001 would be 2001)
yyyy Year, (e.g. 2001 would be 2001)
K Represents the time zone information of a date and time value (e.g. +05:00)
z With DateTime values, represents the signed offset of the local operating system's time zone from Coordinated Universal Time (UTC), measured in hours. (e.g. +6)
zz As z but with leadin zero (e.g. +06)
zzz With DateTime values, represents the signed offset of the local operating system's time zone from UTC, measured in hours and minutes. (e.g. +06:00)
f Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value.
ff Represents the two most significant digits of the seconds fraction; that is, it represents the hundredths of a second in a date and time value.
fff Represents the three most significant digits of the seconds fraction; that is, it represents the milliseconds in a date and time value.
ffff Represents the four most significant digits of the seconds fraction; that is, it represents the ten thousandths of a second in a date and time value. While it is possible to display the ten thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
fffff Represents the five most significant digits of the seconds fraction; that is, it represents the hundred thousandths of a second in a date and time value. While it is possible to display the hundred thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
ffffff Represents the six most significant digits of the seconds fraction; that is, it represents the millionths of a second in a date and time value. While it is possible to display the millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
fffffff Represents the seven most significant digits of the seconds fraction; that is, it represents the ten millionths of a second in a date and time value. While it is possible to display the ten millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
F Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value. Nothing is displayed if the digit is zero.
: Represents the time separator defined in the current DateTimeFormatInfo..::.TimeSeparator property. This separator is used to differentiate hours, minutes, and seconds.
/ Represents the date separator defined in the current DateTimeFormatInfo..::.DateSeparator property. This separator is used to differentiate years, months, and days.
" Represents a quoted string (quotation mark). Displays the literal value of any string between two quotation marks ("). Your application should precede each quotation mark with an escape character (\).
' Represents a quoted string (apostrophe). Displays the literal value of any string between two apostrophe (') characters.
%c Represents the result associated with a c custom format specifier, when the custom date and time format string consists solely of that custom format specifier. That is, to use the d, f, F, h, m, s, t, y, z, H, or M custom format specifier by itself, the application should specify %d, %f, %F, %h, %m, %s, %t, %y, %z, %H, or %M. For more information about using a single format specifier, see Using Single Custom Format Specifiers.

Friday, May 30, 2008

Regular Expression that accepts 0-9,space,/,+,- only

^([0-9][\ ][\/][\+][\-])*$

The below link can be used to test your regular expressions:
http://www.dotnetcoders.com/web/Learning/Regex/RegexTester.aspx

Calling a web-service

Here I am not concerned about creating a web-service & consuming it. I hope you know this already. But sometimes when you consume the web-service in .NET it throws an exception like 'The request failed with HTTP status 401 : unauthorized'. When you try to run the web-service directly, it runs without fail.


Resolution:

Dim obj As New basicops.operations
obj.Credentials = System.Net.CredentialCache.DefaultCredentials

lblResult.Text = "Result: " & obj.Subtract(Convert.ToInt32(TextBox1.Text), Convert.ToInt32(TextBox2.Text)).ToString()

Thursday, April 24, 2008

What happens when an asp.net page is requested from the browser

From the browser the request is sent to IIS. There is an aspnet_isapi.dll in IIS that takes care of serving the request. From this it sends the request to .net framework's worker process. (aspnet_wp.exe)

From IIS there is a mapping that specifies the which isapi is going to process that page. From the website properties, From virtual directory tab, click on 'configuration' button. This shows the application configuration window.



At its core, the ASP.NET execution engine compiles the page into a class, which derives from the code behind class (which in turn derives directly or indirectly from the Page class). Then it injects the newly created class into the execution environment, instantiates it, and executes it.

Sunday, April 20, 2008

Crystal Reports in ASP.NET

using CrystalDecisions.CrystalReports.Engine;
-----------------------------------------------------------------------------

ReportDocument rptDoc = new ReportDocument();
rptDoc.Load(Server.MapPath("rptOne.rpt"));

for (int index = 0; index < rptDoc.Database.Tables.Count; index++)
{
rptDoc.Database.Tables[index].LogOnInfo.ConnectionInfo.ServerName = "BHARATIKUMAR";
rptDoc.Database.Tables[index].LogOnInfo.ConnectionInfo.DatabaseName = "Employee";
rptDoc.Database.Tables[index].LogOnInfo.ConnectionInfo.UserID = "kumar";
rptDoc.Database.Tables[index].LogOnInfo.ConnectionInfo.Password = "kumar";
rptDoc.Database.Tables[index].ApplyLogOnInfo(rptDoc.Database.Tables[index].LogOnInfo);
}


crvOne.ReportSource = rptDoc;

crvOne.DataBind();

Thursday, April 10, 2008

Posting to my blog after a very long time

Hi everyone,

In my office, firewall do blocks blogger.com website. Hence couldnt login & couldnt paste to my blog. After 8 months this is the first time I am logging into my blogger.

I am into a production support & enhancement project now. Going to work on MCMS 2002 (Microsoft Content Management Server 2002). I hope MCMS is interesting.

:-) Will keep posting stuff on MCMS from now onwards.

Friday, September 7, 2007

Upload a file in Window application


if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                FileInfo f = new FileInfo(openFileDialog1.FileName);
                string[] fName;
                fName = openFileDialog1.FileName.Split(new char[] {'\\'} );

                f.CopyTo("C:\\Bharathi\\" + fName[fName.Length-1]);

                FileStream fs = new FileStream("C:\\Bharathi\\" + fName[fName.Length - 1], FileMode.Open);
                StreamReader sr = new StreamReader(fs);

                MessageBox.Show(sr.ReadToEnd());

               
                //System.IO.File.ReadAllBytes(openFileDialog1.FileName);
            }

VB.NET + ASP.NET + Data Grid + V1.x


&lt;asp:datagrid id="dgUserCampaigns" DataKeyField="UserCampaignId" runat="server" CssClass="bordergrid"
                                                                                                                AllowSorting="True" GridLines="Horizontal" ShowHeader="False" AutoGenerateColumns="False"
                                                                                                                CellPadding="3" AllowPaging="False" Width="100%"&gt;
                                                                                                               
&lt;ItemStyle Height="20px" CssClass="GridItem"&gt;&lt;/ItemStyle&gt;
                                                                                                               
&lt;HeaderStyle HorizontalAlign="Left" Height="22px" CssClass="GridHeader" Font-Bold="True" VerticalAlign="Middle"&gt;&lt;/HeaderStyle&gt;
                                                                                                               
&lt;FooterStyle Height="18px"&gt;&lt;/FooterStyle&gt;
                                                                                                               
&lt;Columns&gt;
                                                                                                                        &lt;asp:BoundColumn Visible="False"&gt;&lt;/asp:BoundColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="False"&gt;
                                                                                                                                &lt;ItemStyle Width="0%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        &lt;asp:linkbutton Runat="server" ID="lnkCreatedDate" CssClass="gridheaderlink" Font-Bold="True" CommandName="sort"
                                                                                                                                                CommandArgument="CreatedDate"&gt;Created&lt;/asp:linkbutton&gt;
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Label Runat="server" CssClass="fontblue" ID="lblCreatedDate" text='&lt;%# GenValidations.GetDateValue(Databinder.Eval(container.Dataitem,"CreatedDate"))%&gt;' &gt;
                                                                                                                                        &lt;/asp:Label&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="False"&gt;
                                                                                                                                &lt;ItemStyle Width="0%" HorizontalAlign="left"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Type
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Label Runat="server" CssClass="fontblue" ID="lblType" text='&lt;%# Databinder.Eval(container.Dataitem,"TemplateType")%&gt;' &gt;
                                                                                                                                        &lt;/asp:Label&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="False"&gt;
                                                                                                                                &lt;HeaderStyle HorizontalAlign="Center"&gt;&lt;/HeaderStyle&gt;
                                                                                                                                &lt;ItemStyle Width="0%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Draft
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Image ID="imgDraft" ImageUrl="../Images/status.gif" BorderWidth="0" Runat="server" Visible='false'&gt;&lt;/asp:Image&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="false"&gt;
                                                                                                                                &lt;ItemStyle Width="0%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Scheduled
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Image ID="imgScheduled" ImageUrl="../Images/status.gif" BorderWidth="0" Runat="server"
                                                                                                                                                Visible=''&gt;&lt;/asp:Image&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="False"&gt;
                                                                                                                                &lt;ItemStyle Width="0%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Send
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Image ID="imgSent" ImageUrl="../Images/status.gif" BorderWidth="0" Runat="server" Visible='false'&gt;&lt;/asp:Image&gt;
                                                                                                                                        &lt;asp:Label id="lblSend" Runat="server" visible="False" text=''&gt;&lt;/asp:Label&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="False"&gt;
                                                                                                                                &lt;ItemStyle Width="0%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Delivered
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Image ID="imgDelivered" ImageUrl="../Images/status.gif" BorderWidth="0" Runat="server"
                                                                                                                                                Visible='false'&gt;&lt;/asp:Image&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="False"&gt;
                                                                                                                                &lt;ItemStyle Width="0%"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        &lt;asp:linkbutton Runat="server" ID="lnkDeliveryDate" CssClass="gridheaderlink" Font-Bold="True" CommandName="sort"
                                                                                                                                                CommandArgument="DeliveryDate"&gt;Delivery Date&lt;/asp:linkbutton&gt;
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Label Runat="server" CssClass="fontblue" ID="lblDeliveryDate" text='&lt;%# Databinder.Eval(container.Dataitem,"DeliveryDate","{0:MM/dd/yyyy}")%&gt;' &gt;
                                                                                                                                        &lt;/asp:Label&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="False"&gt;
                                                                                                                                &lt;HeaderStyle HorizontalAlign="Center"&gt;&lt;/HeaderStyle&gt;
                                                                                                                                &lt;ItemStyle Width="0%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Mail
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:LinkButton Runat="server" ID="lnkEditMail" CommandName="Email"&gt;
                                                                                                                                                &lt;img src="../Images/mail.gif" border="0"&gt;
                                                                                                                                        &lt;/asp:LinkButton&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="False"&gt;
                                                                                                                                &lt;ItemStyle Width="0%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        &lt;asp:linkbutton Runat="server" ID="lnkCampaignStatus" CssClass="gridheaderlink" Font-Bold="True"
                                                                                                                                                CommandName="sort" CommandArgument="CampaignStatus"&gt;Status&lt;/asp:linkbutton&gt;
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Label Runat="server" CssClass="fontblue" ID="lblCampaignStatus" ForeColor='&lt;%# GenValidations.GetCampaignStatusColor(Databinder.Eval(container.Dataitem,"CampaignStatus"))%&gt;' text='&lt;%# GenValidations.GetCampaignStatus(Databinder.Eval(container.Dataitem,"CampaignStatus"))%&gt;' &gt;
                                                                                                                                        &lt;/asp:Label&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn Visible="False"&gt;
                                                                                                                                &lt;ItemStyle Width="0%" HorizontalAlign="left"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Campaign Description
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Label Runat="server" CssClass="fontblue" ID="lblCampaignDescription" Visible=False text='&lt;%# Databinder.Eval(container.Dataitem,"CampaignDescription")%&gt;' &gt;
                                                                                                                                        &lt;/asp:Label&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn&gt;
                                                                                                                                &lt;HeaderStyle HorizontalAlign="Center"&gt;&lt;/HeaderStyle&gt;
                                                                                                                                &lt;ItemStyle Width="9%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        &lt;asp:CheckBox Runat="server" ID="chkCheckAll" CssClass="font1"&gt;&lt;/asp:CheckBox&gt;
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &nbsp;&nbsp;
                                                                                                                                        &lt;asp:CheckBox Runat="server" ID="chk1" CssClass="font1"&gt;&lt;/asp:CheckBox&gt;
                                                                                                                                        &lt;asp:TextBox ID="txtUserCampaignId" CssClass="gridlink" Runat=server text='&lt;%# Databinder.Eval(container.Dataitem,"UserCampaignId")%&gt;' style="Width:0;Height:0;visibility:hidden"&gt;
                                                                                                                                        &lt;/asp:TextBox&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn&gt;
                                                                                                                                &lt;HeaderStyle&gt;&lt;/HeaderStyle&gt;
                                                                                                                                &lt;ItemStyle Width="28%"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        &lt;asp:linkbutton Runat="server" ID="lnkCampaignSort" CssClass="gridheaderlink" Font-Bold="True" CommandName="sort"
                                                                                                                                                CommandArgument="CampaignName"&gt;Campaigns&nbsp;&lt;img src="../Images/arrdown.gif" border="0"&gt;&lt;/asp:linkbutton&gt;
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:LinkButton id="lnkCampaignName" CssClass="gridlink" tooltip='&lt;%# Databinder.Eval(container.Dataitem,"CampaignName")%&gt;' text='&lt;%# Genvalidations.GetStringValueWithwrap(Databinder.Eval(container.Dataitem,"CampaignName"),18)%&gt;' Runat="server" CommandName="Summary"&gt;
                                                                                                                                        &lt;/asp:LinkButton&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn&gt;
                                                                                                                                &lt;ItemStyle Width="10%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        &lt;asp:linkbutton Runat="server" ID="Linkbutton1" CssClass="gridheaderlink" Font-Bold="True" CommandName="sort"
                                                                                                                                                CommandArgument="CampaignStatus"&gt;Status&lt;/asp:linkbutton&gt;
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:Label Runat="server" CssClass="fontblue" ID="Label1" text='&lt;%# GenValidations.GetDateValue(Databinder.Eval(container.Dataitem,"CreatedDate"))%&gt;' &gt;
                                                                                                                                        &lt;/asp:Label&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:ButtonColumn Visible="False" Text="Edit" HeaderText="Edit" CommandName="Edit"&gt;
                                                                                                                                &lt;HeaderStyle HorizontalAlign="Center"&gt;&lt;/HeaderStyle&gt;
                                                                                                                                &lt;ItemStyle HorizontalAlign="Center" Width="8%" CssClass="gridlink" VerticalAlign="Middle"&gt;&lt;/ItemStyle&gt;
                                                                                                                        &lt;/asp:ButtonColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn&gt;
                                                                                                                                &lt;HeaderStyle HorizontalAlign="Center"&gt;&lt;/HeaderStyle&gt;
                                                                                                                                &lt;ItemStyle Width="10%" HorizontalAlign="center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:ImageButton ID="imgCampaignSummary" Runat="server" ImageUrl="../Images/Zoom.gif" BorderWidth="0"
                                                                                                                                                CommandName="Summary"&gt;&lt;/asp:ImageButton&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn&gt;
                                                                                                                                &lt;HeaderStyle HorizontalAlign="Center"&gt;&lt;/HeaderStyle&gt;
                                                                                                                                &lt;ItemStyle Width="9%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Edit
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:LinkButton Runat="server" ID="lnkEditMessage" CommandName="Edit"&gt;
                                                                                                                                                &lt;img src="../Images/Edit.gif" border="0"&gt;
                                                                                                                                        &lt;/asp:LinkButton&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn&gt;
                                                                                                                                &lt;HeaderStyle HorizontalAlign="Center"&gt;&lt;/HeaderStyle&gt;
                                                                                                                                &lt;ItemStyle Width="9%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Delete
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:LinkButton Runat="server" ID="lnkDelete" CommandName="Delete"&gt;
                                                                                                                                                &lt;img src="../Images/Delete.gif" border="0"&gt;
                                                                                                                                        &lt;/asp:LinkButton&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                                        &lt;asp:TemplateColumn&gt;
                                                                                                                                &lt;HeaderStyle HorizontalAlign="Center"&gt;&lt;/HeaderStyle&gt;
                                                                                                                                &lt;ItemStyle Width="9%" HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                                                                                                                &lt;HeaderTemplate&gt;
                                                                                                                                        Summary
                                                                                                                                &lt;/HeaderTemplate&gt;
                                                                                                                                &lt;ItemTemplate&gt;
                                                                                                                                        &lt;asp:LinkButton Runat="server" ID="lnkSummary" CommandName="Summary"&gt;
                                                                                                                                                &lt;img src="../Images/book.gif" border="0"&gt;
                                                                                                                                        &lt;/asp:LinkButton&gt;
                                                                                                                                &lt;/ItemTemplate&gt;
                                                                                                                        &lt;/asp:TemplateColumn&gt;
                                                                                                               
&lt;/Columns&gt;
                                                                                                       
&lt;/asp:datagrid&gt;