HighDots Forums  

Does anybody know of a good asp.net form processingscript

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Does anybody know of a good asp.net form processingscript in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
M.E. Again
 
Posts: n/a

Default Does anybody know of a good asp.net form processingscript - 01-04-2006 , 07:04 PM






I was hoping to find a good asp.net form processing script that I can use to
update about a bajillion forms to email...

Ugh... I have been looking for ages. I have DW MX, MX2k4, and DW8...

Any suggestions will be appreciated!!!

Thanks in advance!


Reply With Quote
  #2  
Old   
darrel
 
Posts: n/a

Default Re: Does anybody know of a good asp.net form processing script - 01-04-2006 , 07:05 PM






Quote:
I was hoping to find a good asp.net form processing script that I can use
to
update about a bajillion forms to email...

Ugh... I have been looking for ages. I have DW MX, MX2k4, and DW8...

Any suggestions will be appreciated!!!
There's not really a generic 'script' per se. This is a built-in function in
asp.net.

You can use .net's validation controls to validate the form, then via .net,
just pass the data to a DB or an email.

-Darrel





Reply With Quote
  #3  
Old   
M.E. Again
 
Posts: n/a

Default Re: Does anybody know of a good asp.net form processingscript - 01-04-2006 , 09:27 PM



You're kidding me.

I don't suppose you could post some sample code I could shamelessly plagerize??


Reply With Quote
  #4  
Old   
darrel
 
Posts: n/a

Default Re: Does anybody know of a good asp.net form processing script - 01-05-2006 , 10:04 AM



Quote:
I don't suppose you could post some sample code I could shamelessly
plagerize??
If you're doing ASP.net, I strongly suggest you get VS.net. The validators
are built into that.

But, for a sample validataor:

..ASPX:

<asp:requiredfieldvalidator id=RequiredFieldValidator_Name runat="server"
enableclientscript="False" errormessage="<a href='#yourNameField'>Your name
is required</a>" controltovalidate="TextBox_name" font-bold="True"><img
src='/assets/icons_alert.gif' width='22' height='14' alt=''>Name
Required</asp:requiredfieldvalidator>

(there are all sorts of validator controls in .net...google to find more
about them)

And to send the mail:

Sub btnSubmitMessage_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmitMessage.Click
'check for
'form validity and either show errors, or send message
Page.Validate()
If (Page.IsValid) Then
'send email

Dim EMServer As String
EMServer =
System.Configuration.ConfigurationSettings.AppSett ings("EmServer")
LblEmail.Text = objDataReader("email").ToString
LblContact.Text = objDataReader("contact").ToString & " - "
& objDataReader("description").ToString
strCustomSubject = trim(objDataReader("emailSubjectSuffix").ToString)

Dim MyMessage As New MailMessage
MyMessage.To = LblEmail.Text
MyMessage.From = TextBox_email.Text

MyMessage.Subject = TextBox_Subject.text

MyMessage.BodyFormat = MailFormat.Text
MyMessage.Body = "This message has been sent from the MJB website:"
& _
vbcrlf & "----------------------------------------------------------" & _
vbcrlf & "From: " & TextBox_name.text & _
vbcrlf & "Email: " & TextBox_email.text & _
vbcrlf & "Phone: " & TextBox_phone.text & _
vbcrlf & "================================================= =========" & _
vbcrlf & vbcrlf & TextBox_message.Text
SmtpMail.SmtpServer = EMServer
SmtpMail.Send(MyMessage)


Else 'page isn't valid
'don't send email

End If ' page.IsValid
End Sub




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.