Wednesday, March 24, 2010

Old IIS problem

I spent two good hours to figure out a tricky problem.
Scenario: I have two masterpages pointing to one code_behind. By doing this, I can have different layouts for different login. Locally, it runs perfectly. After I publish to server and test it on the net, I got
"Server Error in '/' Application."

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30456: 'CreateResourceBasedLiteralControl' is not a member of 'ASP.masterpage_master'.


Basically, Old IIS (v2.0) doesn't like code reuse -- The solution is to create two vb files that are identical masterpage code-behind for both masterpages (sure, you can make a difference there). And the old IIS satisfied.

Two good articles about masterpages.
http://www.asp.net/(S(pdfrohu0ajmwt445fanvj2r3))/learn/moving-to-asp.net-2.0/module-04.aspx
http://odetocode.com/Articles/450.aspx
http://www.beansoftware.com/ASP.NET-Tutorials/Master-Pages.aspx

No comments:

Post a Comment