Online Product Info
Using a Text Editor with ASP.NET Auto DB

Description
ASP.NET forms can be created with any text editor such as Microsoft Notepad. While design-time capabilities like drag-and-drop, property dialogs, and auto-complete are nice...some people like the simplicity of text editors or want to stick with a visual editor that doesn't provide design-time support for ASP.NET controls and components.

TIP: Many customers first design their page using their favorite editor, then open that page with ASP.NET Web Matrix or Visual Studio .NET to add the form fields. Remember, your form tag must include an ID and RUNAT="server"

If you prefer to work with the HTML directly, ASP.NET Auto DB requires two key entries in your HTML. The first is the Register directive, which tells ASP.NET about the control. The second is the Auto DB Tag that is placed within your form tags. See Listing A for examples of both.

<%@ Register TagPrefix="cc1" Namespace="By360Impact.AutoDB" Assembly="By360Impact.AutoDB" %>
...
<!--Place the Auto DB Control tag between your <Form runat="server"></Form> tags--> <cc1:AutoDB id="AutoDB1" runat="server"> </cc1:AutoDB>
Listing A

ASP.NET Auto DB Control Tag with ALL Properties Included
For your convenience, we have provided a complete Auto DB control tag that includes many of the Auto DB properties (see Listing B), so you can cut and paste it into your HTML and remove the properties you don't need. 

Note: You should cut and paste this complete tag into Notepad first to remove HTML Formatting if you plan to use it in an HTML-aware interface like MS Word, MS FrontPage, etc.


<cc1:AutoDB id="AutoDB1" runat="server"
MailServer
="mail.mycompany.com" 
SMTPUser="MyUserID" 
SMTPPass="MyPass" 
CSVAction="Store"
CSVFileName="/Data/Subscribers.csv"
DebugOn="False"
MaxFileSize="2" 
UploadDir="/uploads"
CompressUploadedFiles
="True"
AR_FromAddr
="info@mycompany.com"
AR_HTMLFormat
="True" 
AR_Subject="We have received your information" 
AR_TemplateFile="standard.html" 
AR_ToAddr="<#Email_Address#>"
RedirectURL
="thanks.aspx"></cc1:AutoDB>
Listing B

 

TIP: If you are utilizing the CSV or Upload capabilities...or writing to an Access database, you will need to give the ASPNET user read/write/modify/delete permissions for those files and folders on your website (ask your administrator if you have questions.)

In addition, if you are uploading files, your form tag will need to look like this:
<form id="myform"
 encType="multipart/form-data"  runat="server">

Finally, all the fields in your form must have id="fieldname" runat="server"
© copyright 2004 360 IMPACT. All rights reserved.