-
How do I - render url in server panel control
I can put a panel control on my webform, add a literal control to it and write
html to the panel.
How can I get the html from a url and do the same thing?
Thanks
-
Re: How do I - render url in server panel control
Hi David,
"David Hermansen" <david.hermansen@anentsoftware.com> wrote in message
news:3c780dbb$1@10.1.10.29...
> I can put a panel control on my webform, add a literal control to it and write
> html to the panel.
> How can I get the html from a url and do the same thing?
Here's a link to an article that explains the technique:
http://www.4guysfromrolla.com/webtech/070601-1.shtml
--
Constance Petersen, DevX newsgroup section leader
SoftMedia Artisans, Inc.
http://www.smartisans.com
For useful, usable software and Web sites
Featured Web design: http://www.keweenawnow.com/
--
Please reply in the newsgroup so everyone can benefit
-
Re: How do I - render url in server panel control
"David Hermansen" <david.hermansen@anentsoftware.com> wrote:
>
>I can put a panel control on my webform, add a literal control to it and
write
>html to the panel.
>
>How can I get the html from a url and do the same thing?
>
>Thanks
Thanks for the href Constance.
This works in a webform (VB.net v1 RTM).
I didn't do any postbacks. I just tried to get it to work once.
Option Explicit On
Option Strict On
Imports System.Net
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel
Private objpanelhtml As New LiteralControl()
Private objWebClient As New WebClient()
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
'Put user code to initialize the page here
Dim byteRequestedHTML() As Byte
Dim objUTF8Encoding As New System.Text.UTF8Encoding()
Const strURL As String = "http://www.yahoo.com"
Dim strRequestedHTML As String
Me.Panel1.Controls.Add(objpanelhtml)
byteRequestedHTML = objWebClient.DownloadData(strURL)
strRequestedHTML = objUTF8Encoding.GetString(byteRequestedHTML)
objpanelhtml.Text = strRequestedHTML
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|