Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3235168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:28:32+00:00 2026-05-17T17:28:32+00:00

I have a .aspx file and would like to add some HTML to it.

  • 0

I have a .aspx file and would like to add some HTML to it. The problem is that it can’t be modified. If I upgrade the product, this .aspx file will be overwritten and my modifications would have to be done again.

This is an open source product, so I can have a look at the codebehind. Again, I cannot modify it because that would break my upgrade path. Also, I need to add functionality that would never be included in the product, so sending in a patch is useless.

The class that’s referred to is a partial class, so I tried implementing an extra Page_PreRender by creating another partial class of the same name in the same namespace. However, since this is in another assembly, .net says it doesn’t know which is the correct class.

Is there any way I can do this?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:28:33+00:00Added an answer on May 17, 2026 at 5:28 pm

    So you can neither touch the .aspx of this page, nor the assembly containing its code behind? Sounds like you need to create a PageAdapter.

    Say you’re given this page…

    <%@ Page AutoEventWireup="true" ContentType="text/plain" Inherits="WebForm1" %>
    
    SomeControl: <asp:Literal runat="server" ID="SomeControl" />
    

    …with this code behind (in an assembly that you can only reference, not modify).

    public class WebForm1 : Page {
        protected void Page_Load(object sender, EventArgs e) {
            var SomeControl = (Literal) FindControl("SomeControl");
            SomeControl.Text = "Value set from code-behind.";
        }
    }
    

    What you can do is create a PageAdapter like so (in your own assembly):

    public class WebForm1Adapter : PageAdapter {
        protected override void OnLoad(EventArgs e) {
            base.OnLoad(e);
            var SomeControl = (Literal) Page.FindControl("SomeControl");
            SomeControl.Text = "Value set from control adapter.";
        }
    }
    

    Then finally, you need to register your override by creating a browser definition file:

    <browsers>
      <browser refID="Default">
        <controlAdapters>
          <adapter controlType="WebForm1" adapterType="WebForm1Adapter" />
        </controlAdapters>
      </browser>
    </browsers>
    

    Check the PageAdapter and ControlAdapter documentation to find out all the ways you can override the normal page behavior.

    This should make updating the third party page much less painful. No matter what you do though, merging updates will be inherently brittle. That is, unless the author of the third party page is consciously presenting some form of a stable API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView in my aspx file like this: <asp:ListView ID=ListView1 runat=server></asp:ListView> and
Well i have a http handler that is set up like this <add name=DocumentHandler
How can I accomplish this in JqueryMobile I have a an aspx file which
I have an .aspx file that outputs an image using the following methods: Server.MapPath(somefile.png)
I have this: <textarea name=content></textarea> and in javascript code in the same aspx file
Inside my aspx file, I have the following html code inside an repeater: <div
I have a rewrite rule in my web.config file like this: <rule name=Public page
I have created a html5 canvas and javascript signature pad that I would like
My problem looks like this. I have a grid with documents (Id's). Now when
I have a MVC3 application that I would like to port to MVC4. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.