changing rendered page just before it gets to the user

Discussion in 'ASP .Net' started by david2tm, Oct 6, 2006.

  1. david2tm

    david2tm Guest

    hello)

    i have some task to coplete, and cant find any way how to do it

    in my asp.net (2.0 c#) i do some work, rendering pages...
    in those pages, are url's presented, writen in some manner... let say

    * "~/somepage.aspx"
    * "^/somepage2.aspx"

    now, i want to change this

    "~" to a server url like "http://www.example.com"
    and "^" to "http://www.test.com", let's say

    so, i think it will be good to it after the page was rendered, just
    before sending it the client
    how to catch that page

    globaly, not onle fot single page

    ....thanx
     
    david2tm, Oct 6, 2006
    #1
    1. Advertisements

  2. david2tm

    david2tm Guest

    *** jump
     
    david2tm, Oct 7, 2006
    #2
    1. Advertisements

  3. david2tm

    Baski Guest

    One idea would be drive all your page from your custom page class, and then
    override prerender method in your custom class , look for your filename and
    make your changes.
     
    Baski, Oct 9, 2006
    #3
  4. david2tm

    david_tm Guest

    thanx
    it's like i do it now
    ...but
    i need to rewrite every text file wich comes from server...
    i mean, for *.css, *.js and *.htc
     
    david_tm, Oct 9, 2006
    #4
  5. david2tm

    Baski Guest

    I just thougt another idea, you can do that in java script also, in your
    custom base page class's page load method, call the javascript function as
    shown below

    Page.RegisterStartupScript("StartupScript", "ReplaceURL()");

    the java script function will be called as shown as page is render to the
    client

    inside your ReplaceURL javascript,

    Find all the link and replace their value. You can use the method names
    var linkCtrls = getElementsByTagName("LINK"); // in java script to get all
    your link names.

    for(var i in linkCtrls)

    {

    linkCtrls.value = do yoour replace ment here

    }
     
    Baski, Oct 9, 2006
    #5
  6. david2tm

    david_tm Guest

    thanx for yout replies...
    it's still will not help me with the other taxt files (not html pages)

    for now, i wrote httphandler to deal with *.css, *.js and *.htc
    and another renderer is used for *.aspx

    but i wanted to use one global method for all taht

     
    david_tm, Oct 9, 2006
    #6
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.