How to resolve error connecting to undo manager of source file in Visual Studio 2008 SP1?

Visual Studio error:

Error connecting to undo manager of source file 'C:\Documents and Settings\kumard\My Documents\Visual Studio 2008\Projects\LANSW.Survey\Survey\Default.aspx.designer.cs'.

Solution:

In the solution explorer find the ‘Default.aspx.designer.cs’ and do the following:

a. Remove Default.aspx.designer.cs

b. Right click on Default.aspx and Convert to Web Application

c. Build your project or solution

d. Run it and it works.

Resources

http://forums.asp.net/t/1100585.aspx

Posted in C#

Date Formatting in C#


Cheat sheet

<%= String.Format("{specifier}", DateTime.Now) %>

Specifier Description Output
d Short Date 08/04/2007
D Long Date 08 April 2007
t Short Time 21:08
T Long Time 21:08:59
f Full date and time 08 April 2007 21:08
F Full date and time (long) 08 April 2007 21:08:59
g Default date and time 08/04/2007 21:08
G Default date and time (long) 08/04/2007 21:08:59
M Day / Month 08 April
r RFC1123 date Sun, 08 Apr 2007 21:08:59 GMT
s Sortable date/time 2007-04-08T21:08:59
u Universal time, local timezone 2007-04-08 21:08:59Z
Y Month / Year April 2007
dd Day 08
ddd Short Day Name Sun
dddd Full Day Name Sunday
hh 2 digit hour 09
HH 2 digit hour (24 hour) 21
mm 2 digit minute 08
MM Month 04
MMM Short Month name Apr
MMMM Month name April
ss seconds 59
tt AM/PM PM
yy 2 digit year 07
yyyy 4 digit year 2007
: seperator, e.g. {0:hh:mm:ss} 09:08:59
/ seperator, e.g. {0:dd/MM/yyyy} 08/04/2007
Posted in C#

How to set fixed width web page sitting in centre of window for IE6x, Firefox, Safari and Chrome

Got a fixed width website and can’t get it to centrally align in the window in Internet Explorer? Or you can get it to centrally align in IE but not in any other browser? Fear not, it’s not your fault! Unfortunately, the correct way of centrally aligning content through CSS doesn’t actually work in IE:

#cim_page-wrapper {
width: 66em;
margin: 0 auto
}

The second command, margin: 0 auto, basically gives our containing element an automatic margin on the left and right, thereby positioning the containing element in the centre of the browser window.

IE however, will need slightly different commands to make this work:

body {
text-align: center
}
#cim_page-wrapper {
width: 66em;
margin: 0 auto;
text-align: left
}

This will then centrally align the container in IE too. To prevent the text from centrally aligning too, we insert text-align: left into the container div.

Posted in CSS