How to upload asp.net project?

P

Pepito Grillo

Hi. I have an asp.net web application and I'd like to upload it to my
web. I uploaded all the .aspx and .config files, so the bin folder
(with the dll). But the problem is that the application does not work
as it does on my computer. The code I use is:

Imports System.IO
Imports System.Net

Public Class analize
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub

'NOTE: The following placeholder declaration is required by the
Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

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
FindCode(Request("TheAddress"))
End Sub

Private Sub FindCode(ByVal TheAddress As String)
Dim wrq As WebRequest
Dim wrp As WebResponse
Dim sr As StreamReader
Dim h As HtmlGenericControl = New HtmlGenericControl

Try
If TheAddress.Substring(0, 7) <> "http://" Then
TheAddress = "http://" & TheAddress
End If
Catch
TheAddress = "http://" & TheAddress
End Try

wrq = WebRequest.Create(TheAddress)
wrp = wrq.GetResponse()
sr = New StreamReader(wrp.GetResponseStream())

h.InnerHtml = sr.ReadToEnd

Page.Controls.Add(h)
End Sub
End Class


This code gets a website address (example: www.microsoft.com).
Then it connects to the page, get its code and write it on my website,
showing the same info but from my server. What am I doing wrong?

Thanks in advance for your help.
 

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top