now I'm getting Request is not available in this context

Posted on 2009-05-16
Last Modified: 2013-12-26
After compilation errors now this error for code
<%@ Page Language="vb" aspcompat=true debug=true Explicit="True" %>

<%@ Assembly Name="ADODB" %>

<%@ Import Namespace="ADODB" %>

<%@ Import Namespace="System.Data" %>

<%@ Import Namespace="System.Data.OleDb" %>

<%@ Import Namespace="System.Web.Mail" %>

<%@ Import Namespace="System.Text" %>

<%@ Import Namespace="System.IO" %>

<%@ Import Namespace="System.Reflection" %>

<%@ Import Namespace="DimpleSoftwares.ASPNET.Components" %>

<script language="vb" runat="server">

Dim Fullname As string = cstr(Request.Form("Fullname"))  

Dim Address As string =  cstr(Request.Form("Address")) 

Dim City As string = cstr(Request.Form("City")) 

Dim States As string = cstr(Request.Form("States")) 

Dim Country As string = cstr(Request.Form("Country")) 

Dim Postcode As string = cstr(Request.Form("Postcode")) 

Dim Phone As string = cstr(Request.Form("Phone")) 

Dim selection2 As string  


    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)




		   If ValidEmail then

		     selection2 = "Email has been successfully sent!"






		    selection2 = "Feedback is alsmost complete! However your email is invalid!"


                    selection4.Text = "Please click the back button and correct this before resubmitting."

                    selection5.Text = "  " 

		   end if		

    End Sub


        Private Function ValidEmail() As Boolean

		Dim e   =  new EmailAddressValidator()


			e.DnsServer = ""

			e.SmtpFromEmail = ""

			e.SmtpFromDomain = ""

			e.UseMXCach = true						


			if e.Validate(cstr(Request.Form("Email")))			

			Return True

			end if			

	End Function


	Private Sub SendMail()

	dim Mail	

	Mail = Server.CreateObject("CDO.Message")

		dim objMessage,objConfig,Flds,MyBody

 		objMessage = Server.CreateObject("cdo.message")

        objConfig = Server.CreateObject("cdo.configuration")

' Setting the SMTP Server

        Flds = objConfig.Fields

        Flds.Item("") = 2

        Flds.Item("") = ""


        objMessage.Configuration = objConfig

        objMessage.To = ""

        objMessage.From = cstr(Request.Form("Email"))

        objMessage.Subject = "From Bonney Place Website"

        MyBody = "Name :" & cstr(Request.Form("Fullname")) &  vbCrLf 

		MyBody = MyBody &  vbCrLf & vbCrLf 

        MyBody = MyBody &  "Phone:" & cstr(Request.Form("Phone")) 

		MyBody = MyBody &  vbCrLf & vbCrLf 

        MyBody = MyBody & "Address:" & cstr(Request.Form("Address")) & "," & cstr(Request.Form("city")) & "," & cstr(Request.Form("States")) & "," & cstr(Request.Form("Country")) & " " & cstr(Request.Form("Postcode")) 

        MyBody = MyBody &  vbCrLf & vbCrLf 

		MyBody = MyBody &  "E-mail:" & cstr(Request.Form("Email")) 

		MyBody = MyBody &  vbCrLf & vbCrLf 


		objMessage.TextBody = MyBody    



        objMessage = nothing

        objConfig = nothing	



    End Sub



Open in new window

Question by:halinab
1 Comment

Accepted Solution

halinab earned 0 total points
ID: 24404139
ok found the problem

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now