473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Interview question

I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)
Nov 18 '05 #1
10 1844
It is possible, right of the top of my head you could always HttpRequest a
page and simply stream it to a string that is coded as
<%=thisstringwillgettherepresentation%>. You might have to clean the body
tag etc. out of it, but it is certainly possible. I am sure if I thought
about it a lil' bit more I could come up with more elegant options.

But I wanna add - yes it is possible, but why in the world would you wanna
do it?

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)

Nov 18 '05 #2
I'm not sure about what you mean....

anyway what about:
<PRE><% Response.Write(contentString); %></PRE>

"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)

Nov 18 '05 #3
Request the page using the net httprequest class and output the resulting
string to a panel control

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)

Nov 18 '05 #4
I couldn't believe someone can ask this in an interview. There is so
much more useful than this one to ask in the interview.

Thanks everone. I'll play with http request class and understand it
better.

"Sahil Malik" <co*****************@nospam.com> wrote in message news:<e4**************@TK2MSFTNGP14.phx.gbl>...
It is possible, right of the top of my head you could always HttpRequest a
page and simply stream it to a string that is coded as
<%=thisstringwillgettherepresentation%>. You might have to clean the body
tag etc. out of it, but it is certainly possible. I am sure if I thought
about it a lil' bit more I could come up with more elegant options.

But I wanna add - yes it is possible, but why in the world would you wanna
do it?

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)

Nov 18 '05 #5
John,

I looked at the httprequest class and couldn't find any method to
request a page from an external web server.

Could you pls let me know the method name?

"John Timney \(Microsoft MVP\)" <ti*****@despammed.com> wrote in message news:<OT*************@TK2MSFTNGP11.phx.gbl>...
Request the page using the net httprequest class and output the resulting
string to a panel control

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)

Nov 18 '05 #6
The .NET documentation on HttpRequest talk only about dealing with the
current web server. There is not much information anywhere on google
on requesting web pages from external web servers,

Finally after much trial and error and with few rate samples, I have
done it. Thought I'll post it here. incase anyone needs it.

HttpWebRequest HttpWReq =
(HttpWebRequest)WebRequest.Create("http://www.yahoo.com");
HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();
StreamReader streamReader = new
StreamReader(HttpWResp.GetResponseStream());
string s = streamReader.ReadToEnd();
streamReader.Close();
HttpWResp.Close();
Label myL = new Label();
myL.Text = s;
Panel1.Controls.Add(myL);

"John Timney \(Microsoft MVP\)" <ti*****@despammed.com> wrote in message news:<OT*************@TK2MSFTNGP11.phx.gbl>...
Request the page using the net httprequest class and output the resulting
string to a panel control

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)

Nov 18 '05 #7
> I couldn't believe someone can ask this in an interview. There is so
much more useful than this one to ask in the interview.
Hey, you had to ask someone else for the answer. Offhand, I would say that
it is a very good question, in that it identifies the level of knowledge of
the interviewee. You, for example, were unable to answer it during the
interview.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om... I couldn't believe someone can ask this in an interview. There is so
much more useful than this one to ask in the interview.

Thanks everone. I'll play with http request class and understand it
better.

"Sahil Malik" <co*****************@nospam.com> wrote in message

news:<e4**************@TK2MSFTNGP14.phx.gbl>...
It is possible, right of the top of my head you could always HttpRequest a page and simply stream it to a string that is coded as
<%=thisstringwillgettherepresentation%>. You might have to clean the body tag etc. out of it, but it is certainly possible. I am sure if I thought about it a lil' bit more I could come up with more elegant options.

But I wanna add - yes it is possible, but why in the world would you wanna do it?

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)

Nov 18 '05 #8
Think about it, it is really a good question. You'd only be able to answer
it if you have gone to the very depths of ASP.NET.

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
Please reply to the newsgroups instead of email so everyone can benefit from
your reply.
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I couldn't believe someone can ask this in an interview. There is so
much more useful than this one to ask in the interview.

Thanks everone. I'll play with http request class and understand it
better.

"Sahil Malik" <co*****************@nospam.com> wrote in message

news:<e4**************@TK2MSFTNGP14.phx.gbl>...
It is possible, right of the top of my head you could always HttpRequest a page and simply stream it to a string that is coded as
<%=thisstringwillgettherepresentation%>. You might have to clean the body tag etc. out of it, but it is certainly possible. I am sure if I thought about it a lil' bit more I could come up with more elegant options.

But I wanna add - yes it is possible, but why in the world would you wanna do it?

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)

Nov 18 '05 #9
Gopal Krish wrote:
I couldn't believe someone can ask this in an interview. There is so
much more useful than this one to ask in the interview.

Thanks everone. I'll play with http request class and understand it
better.


I've been using "screen scraping" for the past couple days actually. It's
pretty useful...

Eric
Nov 18 '05 #10
A question like this would test your understanding of the framework and its
underlying classes, methods and namespaces, rather than your ability to
code.

I ask much harder questions than this when I interview to help determine the
depth of technical understanding that the candidate has. Many people can
use an IDE, but not many understand what it does behind the scenes, and how
the ASP pipeline works.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I couldn't believe someone can ask this in an interview. There is so
much more useful than this one to ask in the interview.

Thanks everone. I'll play with http request class and understand it
better.

"Sahil Malik" <co*****************@nospam.com> wrote in message

news:<e4**************@TK2MSFTNGP14.phx.gbl>...
It is possible, right of the top of my head you could always HttpRequest a page and simply stream it to a string that is coded as
<%=thisstringwillgettherepresentation%>. You might have to clean the body tag etc. out of it, but it is certainly possible. I am sure if I thought about it a lil' bit more I could come up with more elegant options.

But I wanna add - yes it is possible, but why in the world would you wanna do it?

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I was asked this question in an interview.

How can you display the contents of an ASP page (from another web
server) in a aspx page, ie, first half of the screen will display
contents from asp and the other half will be from the current aspx
page. Using frames is not an option.

Any thoughts? (Is this even possible?)

Nov 18 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: Spammay Blockay | last post by:
I've been tasked with doing technical interviews at my company, and I have generally ask a range of OO, Java, and "good programming technique" concepts. However, one of my favorite exercises I...
0
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
by: connectrajesh | last post by:
INTERVIEWINFO.NET http://www.interviewinfo.net FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES NO ADVERTISEMENT
18
by: Nobody | last post by:
I've been looking for a job for a while now, and have run into this interview question twice now... and have stupidly kind of blown it twice... (although I've gotten better)... time to finally...
2
by: freepdfforjobs | last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions http://www.questpond.com/SampleInterviewQuestionBook.zip Download the JAVA , .NET and SQL Server interview sheet and rate...
0
by: freesoftwarepdfs | last post by:
Ultimate list of Interview question website.....Do not miss it http://www.questpond.com http://msdotnetsupport.blogspot.com/2007/01/net-interview-questions-by-dutt-part-2.html...
0
by: Free PDF | last post by:
..NET , SQL Server interview questions websites.... http://www.questpond.com http://www.geocities.com/dotnetinterviews/...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.