是否有一个子程序在加载完整的站点后运行?

时间:2013-12-19 09:36:55

标签: asp.net query-string

我正在使用Page_Load处理表单中的网址:

www.mywebpage.com?ids=1234&user=abcd

我认为Page_Load会在网页完全加载之前触发。

是否有一个子程序在加载完整的网站后运行?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim ids1, user1
    ids1 = Request.QueryString("ids")
    user1 = Request.QueryString("user")
End Sub

继续收到错误:

 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.117.222.18:25

描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码

的更多信息

1 个答案:

答案 0 :(得分:0)

我发现这可以让Querystring有更多时间来阻止这个错误:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.117.222.18:25
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code

Dim client As New WebClient()
Dim data As Stream = client.OpenRead("http://" + Request.ServerVariables("HTTP_HOST") + Request.ApplicationPath & "/PageDetails.aspx?ModuleID=" & ID)
Dim reader As New StreamReader(data)
Dim s As String = reader.ReadToEnd()
data.Close()
reader.Close()