1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to render aspx page in asp

Discussion in 'C#' started by Karthik chennappan, Oct 21, 2010.

  1. #1
    Hi,

    i have an aspx page with some contents. i want to render those aspx contents in my classic asp page.
    please provide your comments with some sample code to achieve this.

    Thanks,
    Karthik C.
     
    Karthik chennappan, Oct 21, 2010 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It would depend on the contents of the aspx file. Obviously the easiest way is to simply put the page in an iframe/frame
     
    AstarothSolutions, Oct 21, 2010 IP
  3. Karthik chennappan

    Karthik chennappan Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    is it possible to call .aspx page from .asp page iframe?
     
    Karthik chennappan, Oct 21, 2010 IP
  4. Karthik chennappan

    Karthik chennappan Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hey Thank you guys... it works fine. I need one more help.

    Now i can call .aspx page from .asp page using iframe/frame. but only the HTML contents are displaying in the UI.

    Means, i have a Datagrid in .aspx and i am fetching the data from DB and filling it.

    if i run the aspx alone the datagrid values are displaying in IE. but the same when i call from .asp the asp page is not diplaying the gird values. its displaying only the HTML design values. See the below example


    <HTML>
    <Body>
    <form>
    Hello...<asp:Datagrid ID="dgSample" runat="server">
    <Columns>
    <asp:BoundColumn DataField="Test"/>
    </Columns>
    </asp:Datagrid>
    </form>
    </Body>
    </HTML>

    From the above HTML code Hello... is displying in asp but he datagrid values are not displaying.
     
    Last edited: Oct 22, 2010
    Karthik chennappan, Oct 22, 2010 IP
  5. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #5
    A link to the live page would be easier. The fact that the .Net page is being contained with in either Frames or iFrames would not make any difference to the .Net engine and so in itself not be the reason the datagrid is not populating.

    Are you trying to pass URL parameters to the datasource or such?
     
    AstarothSolutions, Oct 22, 2010 IP
  6. longcall911

    longcall911 Peon

    Messages:
    1,672
    Likes Received:
    87
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Why would you do such a thing? Why would you try to display the contents of an aspx page in an asp page?

    Just do the right thing. Replace the asp page with the aspx page. Of course, you can only do that if you own both pages.
     
    longcall911, Nov 7, 2010 IP
  7. ITChimesSMO

    ITChimesSMO Peon

    Messages:
    23
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It's not possible.asp is earlier version from asp.net. asp is free version but asp.net is .net frame work oriented.
     
    ITChimesSMO, Nov 12, 2010 IP
  8. rhino2020

    rhino2020 Active Member

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #8
    It's not possible
     
    rhino2020, Nov 12, 2010 IP
  9. teamaguilar

    teamaguilar Peon

    Messages:
    197
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Ya its not possible
     
    teamaguilar, Nov 21, 2010 IP
  10. r.pointing

    r.pointing Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Hello
    Okay, if I create an instance of an .aspx page and set the properties of
    that page, how do I render that instance?
    Server.Transfer creates a new instance of its own and none of the properties
    have been set.
     
    r.pointing, Dec 6, 2010 IP
  11. longcall911

    longcall911 Peon

    Messages:
    1,672
    Likes Received:
    87
    Best Answers:
    0
    Trophy Points:
    0
    #11
    What do you mean 'how do I render that instance?'

    The browser requests the page, any server side scripts are run and the page is sent down to the browser which renders the html. The aspx page must be on an IIS server and must be requested by the browser.

    Server.transfer will not render the page. Server.transfer is a way to redirect to a different page, that's all. Your aspx pages must be on a web server and you must request then from the server to see any 'interactive' components of the page.
     
    longcall911, Dec 6, 2010 IP
  12. miguelf

    miguelf Member

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    48
    #12
    I would suggest that you give up this approach. Just just an aspx for the whole page that way you're able to use web controls and other features of aspx.
     
    miguelf, Jan 13, 2011 IP