CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 4/13/2007 5:49:16 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 10 Views: 24 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
11 Items, 1 Pages 1 |< << Go >> >|
larrydotnet
Asp.Net User
Creating a MasterPage DLL4/13/2007 5:49:16 AM

0/0

Hi people,

I have developed some common behavior inside a Master page and it works fine for all pages inside a web application.

One thing my boss want to achieve is to promote this master page as a DLL in order to share its functionality in a single web site, but others in the intranet.

I am getting a little bit confused about how master pages works and if there is a way to create a dll from a master page.  How to do it? how to use it? What to be careful about?

Please if you have some suggestions let me know.

Thanks in advance.

Larry.


Larry Su?rez.
AshokRaja
Asp.Net User
Re: Creating a MasterPage DLL4/13/2007 9:14:23 AM

0/0

Hi have a look into this article. I hope this will help you

http://odetocode.com/Articles/450.aspx

http://msdn2.microsoft.com/en-us/library/aa479502.aspx

 


Ashok Raja
www.iGold.in

Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
Zhao Ji Ma - MS
Asp.Net User
Re: Creating a MasterPage DLL4/18/2007 3:44:09 AM

0/0

Hi Larry,

ASP.NET 2.0 introduces the App_Code directory, which can contain standalone files that contain code to be shared across several pages in your application. The classes in App_Code get simply compiled into the web site's assembly they belong to, so you don't even need to add a reference to it.


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
larrydotnet
Asp.Net User
Re: Creating a MasterPage DLL4/18/2007 11:34:51 PM

0/0

Hi Zhao and everyone,

One of the solutions is the App_Code directory but in my scenario i have multiple web apps (various virutal directories) and i need to share the same master page inside all of them.

Making it harder... i need to share the same master page in development phase being able to load projects (vs2005) and creating new pages implementing the master page whenever i need.

The main goal is for me to build the main design infrastructure and to delegate the development to the rest part of my team.  (not only design but some javascript and bahavior on the master page)

Please help me to undertand the best way to implement it.

Thanks.

 

 


Larry Su?rez.
Zhao Ji Ma - MS
Asp.Net User
Re: Creating a MasterPage DLL4/19/2007 2:05:34 AM

0/0

Hi Larry,

You can create HTTP based Web Sites in Visual Studio. In IIS Manager, create a virtual directory in each Web Site and make them point to the same common folder. Back in Visual Studio, after refreshing, you can find a common folder is there under each Web Site project. I think you can share your MasterPage in this common folder. Hope it helps!


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
larrydotnet
Asp.Net User
Re: Creating a MasterPage DLL4/19/2007 2:57:44 AM

0/0

Yes Zhao, in fact i did it.  Making a single master page available for many other web projects (using IIS virtual directory).

It works fine "referencing" the master page and also "running" child pages.  The problem is when i am designing and programing a child page in VS, i can not access public properties or methods from the master page.

Only controls defined in the master page can be acceced from the child page using de FindControl method, i think it is because in the child page i dont have the TYPE of the external master page, maybe there could be a way to cast the master doing something like ctype(page.master, [ whatever type]).mypropertyOrMethod=something

 

Maybe there is a special attribute in the MasterType declarative keyword that can help, maybe not...

Any ideas?

Thanks


Larry Su?rez.
larrydotnet
Asp.Net User
Re: Creating a MasterPage DLL4/23/2007 9:16:43 PM

0/0

Hi,

Regarding this topic i have found:

* The first step of creating a virtual directory inside each web application (virtual directory too) is ok.

* The next thing i had to do was going to properties (IIS, right click the application virtual directory) and click the DISABLE button.  It makes the folder stop functioning as virtual direcory and started working as a point of reference folder.

After the last step you can see the content of the foler on VS2005 and see the .aspx and .vb files.  The only concern about that is every single web application contining this shared folder, can modify the files.  But i think it helped me a lot gatting a centralized master page working on other projects for development and deployment.

If you have any other idea or suggestion please let me know.

Thanks in advance. 

 


Larry Su?rez.
larrydotnet
Asp.Net User
Re: Creating a MasterPage DLL4/23/2007 9:18:09 PM

0/0

Hi,

Regarding this topic i have found:

* The first step of creating a virtual directory inside each web application (virtual directory too) is ok.

* The next thing i had to do was going to properties (IIS, right click the new added virtual directory) and click the DISABLE button.  It makes the folder stop functioning as virtual direcory and started working as a point of reference folder.

After the last step, you can see the content of the foler on VS2005 and see the .aspx and .vb files.  The only concern about that is, every single web application contining this shared folder, can modify the files.  But i think it helped me a lot getting a centralized master page working on other projects for development and deployment.

If you have any other idea or suggestion please let me know.

Thanks in advance. 

 


Larry Su?rez.
Zhao Ji Ma - MS
Asp.Net User
Re: Creating a MasterPage DLL4/26/2007 8:24:21 AM

0/0

Hi Larry,

It is true that every web application will contain this shared folder if you use this way. According to you, there are .vb files in this folder, please remove these files (or other code-behind files) in this shared folder after deployment. Since client might be able to down the these code files.

Good Luck!


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
Helaba
Asp.Net User
Re: Creating a MasterPage DLL9/24/2007 3:16:21 PM

0/0

Hey Larry,

I'm also very interested in this question.

 Unfortunatelly, I don't have an answer by now.

Helmut

naturehermit
Asp.Net User
Re: Creating a MasterPage DLL9/24/2007 4:15:38 PM

0/0

larrydotnet:

Yes Zhao, in fact i did it.  Making a single master page available for many other web projects (using IIS virtual directory).

It works fine "referencing" the master page and also "running" child pages.  The problem is when i am designing and programing a child page in VS, i can not access public properties or methods from the master page.

Only controls defined in the master page can be acceced from the child page using de FindControl method, i think it is because in the child page i dont have the TYPE of the external master page, maybe there could be a way to cast the master doing something like ctype(page.master, [ whatever type]).mypropertyOrMethod=something

 

Maybe there is a special attribute in the MasterType declarative keyword that can help, maybe not...

Any ideas?

Thanks

Public properties can be accessed from master page in underlying pages, by just calling the property like so

say there is public property name divAccess you can access it by

Master.divAccess and if it returns something you can even execute methods on it..

like Master.divAccess.clear();

You do need a @MasterType VirtualPath="~/Your.master" directive in the callee page aspx

 

For nested master pages you need to do a cast to reach the top page and this could be... (NAMEOFMASTERCLASS)(page.master.master)


Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations
11 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

Creating a MasterPage DLL - ng.asp-net-forum ... Creating a MasterPage DLL, > ROOT > NEWSGROUP > Asp.Net Forum > ... How to create a common toolbar for using with all pages in an ... DLLs & Assemblies. ...
Creating a MasterPage DLL - ng.asp-net-forum ... Creating a MasterPage DLL, > ROOT > NEWSGROUP > Asp.Net Forum > ... How to create a common toolbar for using with all pages in an ... DLLs & Assemblies. ...
JS-code wont work in MasterPage - ASP.NET Forums ... create a MasterPage in Visual Studio and puts the JS-code in head, then it does not work. ... go ahead and create the directory and add the dll. Jeev ...
CodeProject: Creating a Better Master Page. Free source code and ... DLLs & Assemblies. Exception Handling. Localisation ... Create a MasterPage with some header content, footer content and place holder content, as below. ...
how to include masterpage & Move the DLL inside publishedwesite folder ... ... DLL are created at _PublishedWebsites folder level, we need to create DLL folder inside the _PublishedWebsites folder and move the all DLLs inside the dll ...
MasterPage Class (System.Web.UI) Assembly: System.Web (in System.Web.dll) Syntax. Visual Basic (Declaration) ... When you create a master page by creating your own class first, you must include ...



 
All Times Are GMT