Solved

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

Posted on 2009-05-16
1
263 Views
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!"
                     
                     
		     SendMail()
		     
		   else
		    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 = "58.108.193.62"
			e.SmtpFromEmail = "coach@halinasplace.com.au"
			e.SmtpFromDomain = "mail.halinasplace.com.au"
			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("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.halinasplace.com.au"
        Flds.update
 
        objMessage.Configuration = objConfig
        objMessage.To = "bonneyplace@acslink.net.au"
        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.fields.update
        objMessage.Send
        objMessage = nothing
        objConfig = nothing	
			       	
			       
    End Sub
	
 
</script>

Open in new window

0
Comment
Question by:halinab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

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

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month3 days, 17 hours left to enroll

630 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