CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > visual_studio.vs_2005_web_application_projects Tags:
Item Type: Date Entered: 4/6/2006 8:10:44 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 181 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
"Edgardo" <>
NewsGroup User
Another (little) MasterPage problem4/6/2006 8:10:44 AM

0

I have a MasterPage (Site1) and a content page (WebForm4), if I define the mastertype directive like this:

<%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication1.WebForm4" Title="Untitled Page" %>
<%@ MasterType TypeName="Site1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>

I build the solution, everything seems OK. When I try to see it I get:

"Parser Error Message: Could not load type 'Site1'

It makes sense :), and its obviously fixed by doing:
<%@ MasterType TypeName="Namespace.Site1" %> (WebApplication1 in this case)

I think the compiler should prompt an error just like when you specify a non-existing/invalid mastertype.


-Edgardo
"Edgardo" <>
NewsGroup User
Re: Another (little) MasterPage problem4/6/2006 8:14:37 AM

0

I meant the MasterType TypeName property of course. :)
-Edgardo
"ScottGu" <>
NewsGroup User
Re: Another (little) MasterPage problem4/6/2006 8:18:19 AM

0

That behavior is actually by design (although non-ideal). 

The reason that isn't being flagged at VS compile time is because with VS 2005 Web Application Projects only the code-behind and class files are getting compiled -- not the .aspx markup themselves (this is just like with VS 2003 web projects).  Because the Site1 type is defined within the same namespace as the pages, this technically compiles clean from the code-behind perspective (if you had named it Site2 you would have had a compile error). It is only at runtime when the page executes that it ends up that a fully qualified typename is needed.

One option to get better build-time validation is to hook up a web deployment project to the web application project.  This will perform a deep validation of all markup and .aspx content, and will flag a compiler error if something like the above isn't valid.  The reason we don't do this by default with VS 2005 WAP builds is because the perf impact would significantly impact usability.

Hope this helps,

Scott

"Edgardo" <>
NewsGroup User
Re: Another (little) MasterPage problem4/6/2006 8:43:34 AM

0

Ah, I see. :)

Thanks for the reply.


-Edgardo
"dannychen" <>
NewsGroup User
Re: Another (little) MasterPage problem4/6/2006 10:06:00 PM

0

Another solution is to use the VirtualPath property instead of the TypeName property for defining your MasterType. 

--
Danny


disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:













convert vs 2003 project to vs 2005 with wap. is it possible?

page load is slow(esp images) on windows vista-iis7

migrated wap opens as wsp on another machine

easy one - app_code

upgrade to release build gives "the project type is not supported by this installation"

scroll bar doesn't show up in design view?

settings scope in web application

master page fails to load after conversion to wap

could not find http://schemas.microsoft.com/.netconfiguration/v2.0 in web.config file

error in debug compilation of webapp project "unable to write to output file '[path]\obj\debug\website.pdb': system error &h80004005&"

distributed application diagrams support

merging of two datatables

using reflection to load wap's child wsp's app_code library

app.config/web.cong

converted 1.1 to 2.0 web application project, now project compiles under both models

is it possible to migrate vs2005 web application project to vs2005 web site.

remote debugging web application project

costom role provider does not work in web app project.

wap 1.0?

make sure the application for the project type (.rptproj) is installed

can we extend the precompiled & deployed application in asp.net

where are namespaces defined for .net web apps not defined as class libraries?

vs80-kb915364-x86-enu.exe - the upgrade patch cannot be installed

publish ignores web deployment projects?

bug? cannot drag/drop compositecontrol; specific to web app project

what is override application root url?

visual studios '05 - web page - how do "view code, view markup, and view design" interact?

could not prepare '...' for refactoring

problem with profilecommon

is web application the way to go

why not all lowercase for asp.net tags

problems creating a usercontrol library

object data source cannot find type. attempting ajax walk through - fine through debugger - ajax vid

element 'usercontrol' is not a known element error, after converting to wap

request.applicationpath returning different result after website to web app conversion

no dataadapters in designer anymore?

web service application project and wse 3.0

f7 is not working. "server objects and & events" lost functionality.

controls not visible in run mode

mysterious location of project folders

wap and javascript debugging

web application project and javascript debugging.

com exception in calling

unable to complete web application projects install

'profile common' is ambigous after conversion of website project to website application project

could not find codebehind files

custom control assembly references not resolved correctly

troubles after migrating to web app project

how to generate fixed number of rows in a gridview?

how to know the installed web applications on iis 7.0 whether they are wcf services or sharepoint services

   
  Privacy | Contact Us
All Times Are GMT