Hide path to URL files?

  • Thread starter Thread starter Guest
  • Start date Start date
Asaf said:
Hello,

I have a domain URL on a shared hosting server for example www.mydomain.com
When accessing www.mydomain.com I would like to get the ASPX files from
other domain on other server for example www.otherdomain.com but I would like
the URL on the browser for all the ASPX files will always stay on
www.mydomain.com so the one who browse my website will not see for example
www.otherdoamin.com/Default.aspx

Thanks in advanced for any advice.

Regards,
Asaf

In my understanding, you want to show an aspx file that is located in
different domain, but you don't want to show that domain name while its
get requested, rather you want to show as a content that is coming from
your own domain.

Pretty possible.

1. Create an ASPX page called "another_domain_info.aspx"
2. The below is the code that goes in the .aspx file

<body>
<form id="form1" runat="server">
<div id="yahooHtml" runat="Server"></div>
</form>
</body>

3. Now, in the another_domain_info.aspx.cs file create Page_Load event
and put the below code.

protected void Page_Load(object sender, EventArgs e)
{

WebRequest w = WebRequest.Create("http://www.yahoo.com");
WebResponse wr = w.GetResponse();

StreamReader r = new StreamReader (wr.GetResponseStream());

String html = r.ReadToEnd();

HtmlGenericControl DivElement = this.FindControl("yahooHtml")
as HtmlGenericControl;
DivElement.InnerHtml = html;

r.Close();
wr.Close();
}

4. Now press F5 to execute this code. You can see yahoo's home page in
the aspx file.

Basically, what happens is WebRequest object request the given url and
gets the response coming back from the server. After getting the
response we are binding the response which is html data to the div tag
kept in the .aspx file.

Let me know in case of any issues.

-
Vadivel Kumar
http://vadivelk.net
 
Hi,

Thank you for your post.

Based on my understanding, your question is how to show a page's content
from another domain. If I've misunderstood anything, please feel free to
post here.

You can use iframe to embed another page in your page, for example:

<iframe width="100%" height="100%" frameborder=no
src="http://www.msn.com"></iframe>

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi,

Appreciate your update and response. If you have any other questions or
concerns, please do not hesitate to contact us. It is always our pleasure
to be of assistance.

Have a nice day!

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Ask a Question

Back
Top