Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Dynamically add page directive.

Posted on 2013-12-04
5
Medium Priority
?
387 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
ID: 39696229
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
ID: 39696356
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
ID: 39696375
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 2000 total points
ID: 39700316
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
ID: 39703500
thanks
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

963 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