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.
It would depend on the contents of the aspx file. Obviously the easiest way is to simply put the page in an iframe/frame
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...<aspatagrid ID="dgSample" runat="server"> <Columns> <asp:BoundColumn DataField="Test"/> </Columns> </aspatagrid> </form> </Body> </HTML> From the above HTML code Hello... is displying in asp but he datagrid values are not displaying.
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?
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.
It's not possible.asp is earlier version from asp.net. asp is free version but asp.net is .net frame work oriented.
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.
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.
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.