Is the .master extension of importance

W

WT

Hello,

I want to know if the .master is of any importance for a master page.
Could I have an .ascx extension and the <%@ Matser..%> Directive inside,
will my page load using LoadControl from code ?

Thanks
CS
 
W

WT

I just finished my test and it loads perfectly.....
My expectation is that using masterpages in place of user controls, I could
have MatserPages in user controls...

More later.
CS
 
S

Steven Cheng[MSFT]

Hello CS,

As Gaurav has mentioned, the Master page's "master" extension is a fixed
one which we have to adopt for master pages in our ASP.NET 2.0 application.
Also, since the master page is always requested/loaded by ASP.NET runtime
internally, it doesn't expect users to manually configuer handler for its
extensions in web.config(different from normal ASPX page).

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

WT

Hi Steven,
My question is just in loading the control from code with LoadControl in the
PreInit phase.
Will itnormaaly run as a master page.
Response to-day for my test or before with you ?

Regards
CS
 
S

Steven Cheng[MSFT]

Thanks for your quick reply CS,

I think I may have somewhat misunderstand your scenario. If convenient,
would provide some code snippet about your loadcontrol logic in PreInit?

My original consideration is that you have an existing master page such as
site.master(as below)

===================
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.ascx.cs"
Inherits="Master_site" %>

<!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>
...............

====================

and you want to simply change its name to "site.ascx" or
"site.otherextension". Based on my test, this will raise error. If what you
do is simply use Page.LoadControl to load the "site.master" as a
usercontrol template, I think it will works, but since master page contains
many page level elements(such as server-side <form>), it may conflict with
the current page's form.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top