Data Recovery Forums - Help & Discussions Forum Index

Data Backup Software
Data Recovery Forums - Help & Discussions
Free online data recovery guide to help you find the information you need to recover your data. Discuss and get help about data recovery in this forum.
Data Recovery | RAID Recovery | Laptop Data Recovery

 FAQsFAQs   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Data Recovery Software
Validations of NET controls?

 
Post new topic   Reply to topic    Data Recovery Forums - Help & Discussions Forum Index -> .Net Technologies


 
Author Message
faysal_fuuast



Joined: 30 Dec 2006
Posts: 15
Location: USA

PostPosted: Tue Jan 16, 2007 10:13 pm    Post subject: Validation controls in ASP.NET Reply with quote

Please see the following site for validation controls in .net technologies.

w3schools.com

Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jacobfernandas



Joined: 08 Jul 2009
Posts: 1

PostPosted: Thu Jul 09, 2009 7:24 am    Post subject: Reply with quote

Hey Guys,
Any and all help would be greatly appreciated.

Here is a simple ASP script that collects information and sends an e-mail. There is only one problem. People can just submit a blank one. I have searched around the internet and cannot find any helpful tutorials on this. What I am needing to do is juat make it so that something must be entered in each field. Not anything complex at all, just so that it cannot be blank. One again, any and help would be appreciated. Here is the code:

<%
Dim UsableDate
UsableDate = WeekDayName(WeekDay(Date), true) & ", " & Day(Date) & " " & MonthName(Month(Date), true) & " " & Year(Date) & " " & FormatDateTime(DateAdd("h", 2, now), 4) & " (CST)"

Name = Request.Form("name")
UserEmail = Request.Form("email")
Company = Request.Form("Company")
Street = Request.Form("Street")
Street2 = Request.Form("Street2")
City = Request.Form("City")
State = Request.Form("State")
Zip = Request.Form("Zip")
Phone = Request.Form("phone")
Fax = Request.Form("fax")
Comments = Request.Form("comments")

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "mail.fakewebsite.com"
Mailer.AddRecipient "Sales", "mthomas@fakewebsite.com"
Mailer.FromName = "Online Brochure Request"
Mailer.FromAddress = "do_not_reply@fakewebsite.com"
Mailer.Subject = "Brochure Request"
Mailer.DateTime = UsableDate
If IsEmpty(UserEmail) or IsNull(UserEmail) or UserEmail="" then
Else
Mailer.ReplyTo = UserEmail
End If
Mailer.BodyText = "Date: " & UsableDate &_
VbCrLf &_
VbCrLf & "Name: " & Name &_
VbCrLf & "Company: " & Company &_
VbCrLf & "Email: " & Useremail &_
VbCrLf & "Phone: " & Phone &_
VbCrLf & "Fax: " & Fax &_
VbCrLf & "Street: " & Street &_
VbCrLf & "Street: " & Street2 &_
VbCrLf & "City: " & City &_
VbCrLf & "State: " & State &_
VbCrLf & "Zip: " & Zip &_
VbCrLf & "Comments: " & Comments &_
VbCrLf

'sends mail...required
if Mailer.SendMail then
Response.Redirect "http://www.?.com/confirmation.html"
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>

Thanks,

Back to top
View user's profile Send private message
davidbeckam



Joined: 08 Jul 2009
Posts: 1

PostPosted: Fri Jul 10, 2009 8:14 am    Post subject: Reply with quote

Hey Guys,
Any and all help would be greatly appreciated.

Here is a simple ASP script that collects information and sends an e-mail. There is only one problem. People can just submit a blank one. I have searched around the internet and cannot find any helpful tutorials on this. What I am needing to do is juat make it so that something must be entered in each field. Not anything complex at all, just so that it cannot be blank. One again, any and help would be appreciated. Here is the code:

<%
Dim UsableDate
UsableDate = WeekDayName(WeekDay(Date), true) & ", " & Day(Date) & " " & MonthName(Month(Date), true) & " " & Year(Date) & " " & FormatDateTime(DateAdd("h", 2, now), 4) & " (CST)"

Name = Request.Form("name")
UserEmail = Request.Form("email")
Company = Request.Form("Company")
Street = Request.Form("Street")
Street2 = Request.Form("Street2")
City = Request.Form("City")
State = Request.Form("State")
Zip = Request.Form("Zip")
Phone = Request.Form("phone")
Fax = Request.Form("fax")
Comments = Request.Form("comments")

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "mail.fakewebsite.com"
Mailer.AddRecipient "Sales", "mthomas@fakewebsite.com"
Mailer.FromName = "Online Brochure Request"
Mailer.FromAddress = "do_not_reply@fakewebsite.com"
Mailer.Subject = "Brochure Request"
Mailer.DateTime = UsableDate
If IsEmpty(UserEmail) or IsNull(UserEmail) or UserEmail="" then
Else
Mailer.ReplyTo = UserEmail
End If
Mailer.BodyText = "Date: " & UsableDate &_
VbCrLf &_
VbCrLf & "Name: " & Name &_
VbCrLf & "Company: " & Company &_
VbCrLf & "Email: " & Useremail &_
VbCrLf & "Phone: " & Phone &_
VbCrLf & "Fax: " & Fax &_
VbCrLf & "Street: " & Street &_
VbCrLf & "Street: " & Street2 &_
VbCrLf & "City: " & City &_
VbCrLf & "State: " & State &_
VbCrLf & "Zip: " & Zip &_
VbCrLf & "Comments: " & Comments &_
VbCrLf

'sends mail...required
if Mailer.SendMail then
Response.Redirect "http://www.?.com/confirmation.html"
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Data Recovery Forums - Help & Discussions Forum Index -> .Net Technologies All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Data Recovery London UK | Data Recovery Software

Powered by phpBB © 2001, 2005 phpBB Group