Link to home
Start Free TrialLog in
Avatar of skij
skijFlag for Canada

asked on

How to import System.NET

I would like to use HttpWebRequest and HttpWebResponse with ASP.NET VB.

This gives me an error:
<%

Imports System.Net

Dim myReq As HttpWebRequest
Dim myResp As HttpWebResponse

%>

Open in new window

How can I properly import System.Net?
ASKER CERTIFIED SOLUTION
Avatar of Misha
Misha
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I normally code in the code behind i.e for Default.aspx it is in Default.aspx.vb
Imports System.Net

Public Class _Default

    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim myReq As HttpWebRequest
        Dim myResp As HttpWebResponse


    End Sub

End Class

Open in new window


    <%@ Import Namespace="System.Net" %>
    <%
        Dim myReq As HttpWebRequest
        Dim MyResp As HttpWebResponse

        %>

Open in new window

Avatar of skij

ASKER

Including that top line solved the problem, thanks!