473,811 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1889
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
<%=thisstringwi llgetthereprese ntation%>. 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.goo gle.com...
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.goo gle.com...
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.goo gle.com...
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.co m> wrote in message news:<e4******* *******@TK2MSFT NGP14.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
<%=thisstringwi llgetthereprese ntation%>. 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.goo gle.com...
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*****@despam med.com> wrote in message news:<OT******* ******@TK2MSFTN GP11.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.goo gle.com...
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.Cre ate("http://www.yahoo.com") ;
HttpWebResponse HttpWResp = (HttpWebRespons e)HttpWReq.GetR esponse();
StreamReader streamReader = new
StreamReader(Ht tpWResp.GetResp onseStream());
string s = streamReader.Re adToEnd();
streamReader.Cl ose();
HttpWResp.Close ();
Label myL = new Label();
myL.Text = s;
Panel1.Controls .Add(myL);

"John Timney \(Microsoft MVP\)" <ti*****@despam med.com> wrote in message news:<OT******* ******@TK2MSFTN GP11.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.goo gle.com...
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.goo gle.com... 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.co m> wrote in message

news:<e4******* *******@TK2MSFT NGP14.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
<%=thisstringwi llgetthereprese ntation%>. 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.goo gle.com...
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.goo gle.com...
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.co m> wrote in message

news:<e4******* *******@TK2MSFT NGP14.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
<%=thisstringwi llgetthereprese ntation%>. 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.goo gle.com...
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

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

Similar topics

54
17450
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 give interviewees seems to trip them up all the time, and I wonder if I'm being too much of a hardass... it seems easy enough to ME, but these guys, when I get them up to the whiteboard, seem to get really confused. The exercise is this:
0
6171
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 the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip 2000 Interview questions of .NET , JAVA and SQL Server Interview questions (worth downloading it)
2
6971
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 attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
0
4605
by: connectrajesh | last post by:
INTERVIEWINFO.NET http://www.interviewinfo.net FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES NO ADVERTISEMENT
18
2869
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 figure this thing out... basically the interview question is: given an unsorted listed such as: 3,1,3,7,1,2,4,4,3 find the FIRST UNIQUE number, in this case 7... and of course the list can be millions long...
2
7230
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 yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
0
2671
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 http://msdotnetsupport.blogspot.com/2006/08/net-windows-forms-interview-questions.html http://msdotnetsupport.blogspot.com/2006/08/net-remoting-interview-questions.html http://msdotnetsupport.blogspot.com/2006/08/c-interview-questions.html...
0
2236
by: Free PDF | last post by:
..NET , SQL Server interview questions websites.... http://www.questpond.com http://www.geocities.com/dotnetinterviews/ http://msdotnetsupport.blogspot.com/2007/01/net-interview-questions-by-dutt-part-2.html http://msdotnetsupport.blogspot.com/2006/08/net-windows-forms-interview-questions.html http://msdotnetsupport.blogspot.com/2006/08/net-remoting-interview-questions.html...
0
9734
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10652
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10408
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7673
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5561
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3874
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3026
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.