473,386 Members | 1,720 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,386 software developers and data experts.

Using a panel question

I have a form where I have a treeview control in the left sidebar and then a
panel next to it in the other pane. Based on user selection from the tree
view, I would like the panel to display a certain html page that was created
in Word as html. Currently I do have the treeview's nodes pointing to a URL,
however for design asthetics, I would love to have the html page just open in
this panel.

How would I got about doing this and thanks for the help.
Nov 19 '05 #1
4 1379
ASP:PANEL is a <DIV> tag when rendered to HTML and <DIV> cannot host another
HTML page. Adding an IFRAME to the right panel may be an option. IFRAME can
host new HTML/ASP/ASPX pages.

"Brad" wrote:
I have a form where I have a treeview control in the left sidebar and then a
panel next to it in the other pane. Based on user selection from the tree
view, I would like the panel to display a certain html page that was created
in Word as html. Currently I do have the treeview's nodes pointing to a URL,
however for design asthetics, I would love to have the html page just open in
this panel.

How would I got about doing this and thanks for the help.

Nov 19 '05 #2
Brad,

I wouldn't go the iFrame route myself. You can certainly display the page in
the panel.

Put a literal control into the panel and then get the html code like this:

'---Create the request

Dim WebRequest As System.Net.WebRequest

WebRequest = System.Net.WebRequest.Create(New Uri(CurrentLink))

'---Optionally set the timeout (if you don't the default timeout will be
used)

WebRequest.Timeout = 2000

'---Get the response produced by the request

Dim Response As System.Net.WebResponse = WebRequest.GetResponse

'---Download the page content into a stream

Dim Stream As System.IO.Stream = Response.GetResponseStream

'---Place the stream into a stream reader

Dim StreamReader As New System.IO.StreamReader(Stream)

'---Read the stream into a string object

Dim Html As String = StreamReader.ReadToEnd

'---Cleanup for the next request

Stream.Close()

StreamReader.Close()

Literal1.Text = Html
Now, you may need to parse the html to remove html, head, and/or form tags
depending on what the html you are receiving contains. There are, of course,
tags that could mess up your page's display. But I use this technique to
display newsletters saved as html pages in an archive site and the
surrounding site's format is just fine in every browser. You'll just have to
test to see if any included tags mess things up and remove them from the
Html string if they do...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Sreejith Ram" <Sr*********@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
ASP:PANEL is a <DIV> tag when rendered to HTML and <DIV> cannot host
another
HTML page. Adding an IFRAME to the right panel may be an option. IFRAME
can
host new HTML/ASP/ASPX pages.

"Brad" wrote:
I have a form where I have a treeview control in the left sidebar and
then a
panel next to it in the other pane. Based on user selection from the
tree
view, I would like the panel to display a certain html page that was
created
in Word as html. Currently I do have the treeview's nodes pointing to a
URL,
however for design asthetics, I would love to have the html page just
open in
this panel.

How would I got about doing this and thanks for the help.

Nov 19 '05 #3
There is a lot of overhead in the technique you just described.
For performance reasons I think I'd have to lean toward the IFrame approach
for most situations, depending on your requirements.

Here's more information:
http://www.dotnet2themax.com/ShowCon...4-e565c8eab013

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:%2***************@TK2MSFTNGP10.phx.gbl...
Brad,

I wouldn't go the iFrame route myself. You can certainly display the page
in the panel.

Put a literal control into the panel and then get the html code like this:

'---Create the request

Dim WebRequest As System.Net.WebRequest

WebRequest = System.Net.WebRequest.Create(New Uri(CurrentLink))

'---Optionally set the timeout (if you don't the default timeout will be
used)

WebRequest.Timeout = 2000

'---Get the response produced by the request

Dim Response As System.Net.WebResponse = WebRequest.GetResponse

'---Download the page content into a stream

Dim Stream As System.IO.Stream = Response.GetResponseStream

'---Place the stream into a stream reader

Dim StreamReader As New System.IO.StreamReader(Stream)

'---Read the stream into a string object

Dim Html As String = StreamReader.ReadToEnd

'---Cleanup for the next request

Stream.Close()

StreamReader.Close()

Literal1.Text = Html
Now, you may need to parse the html to remove html, head, and/or form tags
depending on what the html you are receiving contains. There are, of
course, tags that could mess up your page's display. But I use this
technique to display newsletters saved as html pages in an archive site
and the surrounding site's format is just fine in every browser. You'll
just have to test to see if any included tags mess things up and remove
them from the Html string if they do...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Sreejith Ram" <Sr*********@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
ASP:PANEL is a <DIV> tag when rendered to HTML and <DIV> cannot host
another
HTML page. Adding an IFRAME to the right panel may be an option. IFRAME
can
host new HTML/ASP/ASPX pages.

"Brad" wrote:
I have a form where I have a treeview control in the left sidebar and
then a
panel next to it in the other pane. Based on user selection from the
tree
view, I would like the panel to display a certain html page that was
created
in Word as html. Currently I do have the treeview's nodes pointing to a
URL,
however for design asthetics, I would love to have the html page just
open in
this panel.

How would I got about doing this and thanks for the help.


Nov 19 '05 #4
Yes,

I'd agree, if an iFrame is compatible for all potential users of the
application, then that would be the way to go. It's just that while iFrames
are being adopted by more browsers there are still a lot of users out there
who are using older browser versions or browsers that don't render
iFrames...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:es****************@TK2MSFTNGP12.phx.gbl...
There is a lot of overhead in the technique you just described.
For performance reasons I think I'd have to lean toward the IFrame
approach for most situations, depending on your requirements.

Here's more information:
http://www.dotnet2themax.com/ShowCon...4-e565c8eab013

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:%2***************@TK2MSFTNGP10.phx.gbl...
Brad,

I wouldn't go the iFrame route myself. You can certainly display the page
in the panel.

Put a literal control into the panel and then get the html code like
this:

'---Create the request

Dim WebRequest As System.Net.WebRequest

WebRequest = System.Net.WebRequest.Create(New Uri(CurrentLink))

'---Optionally set the timeout (if you don't the default timeout will be
used)

WebRequest.Timeout = 2000

'---Get the response produced by the request

Dim Response As System.Net.WebResponse = WebRequest.GetResponse

'---Download the page content into a stream

Dim Stream As System.IO.Stream = Response.GetResponseStream

'---Place the stream into a stream reader

Dim StreamReader As New System.IO.StreamReader(Stream)

'---Read the stream into a string object

Dim Html As String = StreamReader.ReadToEnd

'---Cleanup for the next request

Stream.Close()

StreamReader.Close()

Literal1.Text = Html
Now, you may need to parse the html to remove html, head, and/or form
tags depending on what the html you are receiving contains. There are, of
course, tags that could mess up your page's display. But I use this
technique to display newsletters saved as html pages in an archive site
and the surrounding site's format is just fine in every browser. You'll
just have to test to see if any included tags mess things up and remove
them from the Html string if they do...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Sreejith Ram" <Sr*********@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
ASP:PANEL is a <DIV> tag when rendered to HTML and <DIV> cannot host
another
HTML page. Adding an IFRAME to the right panel may be an option. IFRAME
can
host new HTML/ASP/ASPX pages.

"Brad" wrote:

I have a form where I have a treeview control in the left sidebar and
then a
panel next to it in the other pane. Based on user selection from the
tree
view, I would like the panel to display a certain html page that was
created
in Word as html. Currently I do have the treeview's nodes pointing to
a URL,
however for design asthetics, I would love to have the html page just
open in
this panel.

How would I got about doing this and thanks for the help.



Nov 19 '05 #5

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

Similar topics

3
by: Dayne | last post by:
Why a panel on another panel (Win. Forms) doesn't display immediately, yet it will once u minimize then reopen the form? I have notice this. I have one panel ( color blue) on top of another panel...
2
by: DotNetMania | last post by:
hi.. i have some question about Quartz.dll.. i am making avi player but there are a lot of problems i have to solve.. i want to know how to implement subtitle.. it means how to draw on...
2
by: Lokhan Wong | last post by:
My question is whether it's possible to change the properties of a panel, that resides on the webform containing the usercontrol, in the usercontrol itself. Like this: <form> <asp:panel...
0
by: Christian Ista | last post by:
Hello, I have a database, a simple table called "FAQ" in this table 3 fields "ID", "QUESTION" and "ANSWER". I'd like for all record return by a query display the question next to an...
1
by: VB Programmer | last post by:
I have 2 flash menus. I put each of them into a panel (1 in each panel (2 panels total)). One flash menu is 200kb, one is only 50kb. (ie Menu for high speed or slow speed connections.) In...
1
by: Larry | last post by:
Dear friends, I am a novice vb.net user and I am seeking some experts advice. I placed a panel control onto a form, set the autoscroll property (of the panel control) to true. Let's say The...
3
by: Ben Dewey | last post by:
Okay, so I have a base Page class called ArticlesPageBase. This base class has reads in an overridable ArticleId and Loads the data into a Panel object in the ContentPlaceHolder of the Master. ...
1
by: Barry L. Camp | last post by:
Hi all, Wondering if someone can help with a nagging problem I am having using a GridView and an ObjectDataSource. I have a simple situation where I am trying to delete a row from a table, but...
3
by: Doc John | last post by:
I have a windows Form that inherits from Base_form. In Base_form I added a panel that covers the whole Form (panel1.Dock = Fill). The problem is that all the controls in the Form that inherit...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.