Solved

Dynamically add page directive.

Posted on 2013-12-04
5
380 Views
Last Modified: 2013-12-07
Is there away to Dynamically add this to a page, either using web.config, or code behind:  


<%@ Master Language="vb" AutoEventWireup="false"  CodeFile="TaborModalPopup.master.vb" Inherits="Tabor.UI.TaborModalPopup" %>
0
Comment
Question by:HLRosenberger
  • 2
  • 2
5 Comments
 
LVL 27

Expert Comment

by:Chinmay Patel
Comment Utility
Which directive you need to add? the entire markup? I don't think that's something that you can do within boundaries of ASP.Net?

Can you throw some light on what exactly you are trying to achieve?
0
 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
I need to add CodeFile and Inherits.  I'm using a Third-Party product that generated code.  Problem is there is no "hook" so to speak to add the directives.  So each time I regenerate, my directives are gone.
0
 
LVL 27

Expert Comment

by:Chinmay Patel
Comment Utility
Hmmm I don't think it is possible during the runtime. You might want to write a little utility that can change these directives for you. Does that third party product has support to include these directives?

I could be wrong here but as long as I know there is no way to dynamically do this during the runtime.
0
 
LVL 11

Accepted Solution

by:
SAMIR BHOGAYTA earned 500 total points
Comment Utility
hi..
You can set the MasterPageFile Property from Code

Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit Me.MasterPageFile = "~/Site.master"
End Sub

Protected Overrides Sub OnPreInit(ByVal e As System.EventArgs)
Me.MasterPageFile = "~/Site.master" MyBase.OnPreInit(e)
End Sub
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
Comment Utility
thanks
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now