Thursday, December 18, 2008

Migrate .NET 2.0 applications to 3.5 confusion about CLR ???

An easy understanding...

See anything specific in above image?
Both DLLs (data and linq) are showing version of 2.0 and 3.5 respectively but the runtime value is same. Aah confusing?

Remember, .NET 3.5 and .NET 2.0 both targets ("runs on" in easy language) .NET 2.0 CLR only.
So if you are planning to deploy any 2.0 APPLICATION in your PROD 3.5 environment it should run without any issues at all.

Note: You may want to test it for AJAX capabilities as that requires a configuraiton tweak.

Post me if need more information on this...

F11 in Datagrid.DataBind() ??? Debugging in .NET source...

* Configure VS IDE 2008 with following settings

in debugger
-> Disable "Enable Just My Code"
-> Enable source server support

in symbols
-> add "http://referencesource.microsoft.com/symbols"
-> Give location "c:\temp\symbols" or anything you want
-> Check "Search above..."

* Load symbols from the call stack of the System.Web.AnyDll (for E.g. Data)

Run F11 on databind and you are in .NET world!

Enjoy!

Wednesday, December 17, 2008

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

I've observed this error many times when <% %> (inline code blocks) are used in master page.

For e.g.

style src='<%=siteurlvariable%>' etc...

Somehow master page does not seems to be entertaining to this and shows .net CODE IN browser wholla!

Fix:

1/
Put your code as
style src='<%# siteurlvariable%>'

2/
Write following piece of code in masterpage.page_load...
Page.Header.Databind()

It Works!

An easy way to make your site look same in IE8 as IE7 (two easy steps)

As IE 8 final version is around the corner, most of the TL/PL/SL… many L’s main confusion, how we will enable our IE7 web version compatible with IE8 in a flick of a second?
Answer is very simple.

There are two options:

# For whole web site (IIS patch)
Add the HTTP header: X-UA-Compatible:IE=EmulateIE7

# For separate pages / master page / header (...)
Add following HTML tag in head section...
meta equiv="X-UA-Compatible" content="IE=EmulateIE7"

What this does?
Simple, IE 8 is loaded with a compatibility mode (kind of newbie), by having this Meta, IE8 will automatically load your site as its loading in IE7

Note: It will be advisable that meanwhile you use any of the above option, your CSS/Designer team is working on fixing the real issues, as this is a temporary patch to make PROD environment working for both browsers IE 7 and 8