Skip to main content
June 7, 2006
Answered

Validation Controls

Created a folrm to insert a recxord into a database.

Server behaviours created:
Insert Record.
ASP.NET E- Mail Validator.
ASP.NET Required Field.

Everything goes ok to the database however the validation controls do not seem to work.

In Visual Studio I wiould have created a button click event.

Private Sub Button1_Click(ByVal sender As System.Object, By Val e as System.EventArgs) handles Button1.Click)
If IsValid Then
Response.Redirect("Success.aspx")
End If
End Sub

How is this done in DW?

The page code as it stands is below.

<form method='POST' name='frmAddrecord' id="frmAddrecord" runat='server'>
<table width="70%" border="0" cellspacing="5" cellpadding="0" summary="Please use the following form to leave us a message.">
<caption>
Contact Us
</caption>
<tr>
<td width="20%">Name:</td>
<td width="48%">
<asp:TextBox ID="txtName" TextMode="SingleLine" runat="server" /> </td>
<td width="32%"><asp:RequiredFieldValidator id="reqName" runat="server" ControlToValidate="txtname" ErrorMessage="Required" Display="Static"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td>E-Mail:</td>
<td><asp:TextBox ID="txtEmail" TextMode="SingleLine" runat="server" /></td>
<td><asp:RegularExpressionValidator id="valEmail" runat="server" ErrorMessage="E-Mail Required" ControltoValidate="txtEmail" ValidationExpression="[\w]+(\+[\w]*)?@([\w-]+\.)+[\w-]+"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td>Comments:</td>
<td>
<asp:TextBox ID="txtComments" Rows="4" Columns="15" TextMode="MultiLine" runat="server" /> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>
<asp:Button ID="btnSubmit" Text="Submit" runat="server" />
<asp:Button ID="btnCancel" Text="Cancel" runat="server" /></td>
<td> </td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="frmAddrecord">
</form>



<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO dbo.contactquery (contact_name, email, question) VALUES (@contact_name, @email, @question)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_conSQLPerenelle") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_conSQLPerenelle") %>'
Expression='<%# Request.Form("MM_insert") = "frmAddrecord" %>'
CreateDataSet="false"
SuccessURL='<%# "contact-sucess.aspx" %>'
FailureURL='<%# "contact-fail.aspx" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@contact_name" Value='<%# IIf((Request.Form("txtName") <> Nothing), Request.Form("txtName"), "") %>' Type="NChar" />
<Parameter Name="@email" Value='<%# IIf((Request.Form("txtEmail") <> Nothing), Request.Form("txtEmail"), "") %>' Type="NChar" />
<Parameter Name="@question" Value='<%# IIf((Request.Form("txtComments") <> Nothing), Request.Form("txtComments"), "") %>' Type="NChar" />
</Parameters>
</MM:Insert>
<MM ageBind runat="server" PostBackBind="true" />
This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer
June 8, 2006
Hi,

Yes I thought I had the updated .dll . Installed again and realisd that the extension was not overwriting the existing control on E:/ but installing into the shard data foldwer on C:/. Copied to Dramweaver and deployed and now working fine. Thanks...

2 replies

Inspiring
June 8, 2006
I believe that there is an issue in the original dreamweavercntl.dll when it
came to validation. Basically as you found out it does not work. If you want
to use DW then I suggest that you download and deploy the replacement
control written by Kevin Marshall and available at
http://www.webxel-dw.co.uk/

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"ricky0110" <webforumsuser@macromedia.com> wrote in message
news:e67212$t4r$1@forums.macromedia.com...
> Created a folrm to insert a recxord into a database.
>
> Server behaviours created:
> Insert Record.
> ASP.NET E- Mail Validator.
> ASP.NET Required Field.
>
> Everything goes ok to the database however the validation controls do not
> seem
> to work.
>
> In Visual Studio I wiould have created a button click event.
>
> Private Sub Button1_Click(ByVal sender As System.Object, By Val e as
> System.EventArgs) handles Button1.Click)
> If IsValid Then
> Response.Redirect("Success.aspx")
> End If
> End Sub
>
> How is this done in DW?
>
> The page code as it stands is below.
>
> <form method='POST' name='frmAddrecord' id="frmAddrecord"
> runat='server'>
> <table width="70%" border="0" cellspacing="5" cellpadding="0"
> summary="Please use the following form to leave us a message.">
> <caption>
> Contact Us
> </caption>
> <tr>
> <td width="20%">Name:</td>
> <td width="48%">
> <asp:TextBox ID="txtName" TextMode="SingleLine" runat="server"
> />
> </td>
> <td width="32%"><asp:RequiredFieldValidator id="reqName"
> runat="server" ControlToValidate="txtname" ErrorMessage="Required"
> Display="Static"></asp:RequiredFieldValidator></td>
> </tr>
> <tr>
> <td>E-Mail:</td>
> <td><asp:TextBox ID="txtEmail" TextMode="SingleLine"
> runat="server"
> /></td>
> <td><asp:RegularExpressionValidator id="valEmail" runat="server"
> ErrorMessage="E-Mail Required" ControltoValidate="txtEmail"
> ValidationExpression="[\w]+(\+[\w]*)?@([\w-]+\.)+[\w-]+"></asp:RegularExpression
> Validator></td>
> </tr>
> <tr>
> <td>Comments:</td>
> <td>
> <asp:TextBox ID="txtComments" Rows="4" Columns="15"
> TextMode="MultiLine" runat="server" /> </td>
> <td> </td>
> </tr>
> <tr>
> <td> </td>
> <td>
> <asp:Button ID="btnSubmit" Text="Submit" runat="server" />
> <asp:Button ID="btnCancel" Text="Cancel" runat="server" /></td>
> <td> </td>
> </tr>
> </table>
> <input type="hidden" name="MM_insert" value="frmAddrecord">
> </form>
>
>
>
> <%@ Page Language="VB" ContentType="text/html"
> ResponseEncoding="iso-8859-1" %>
> <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
> Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,cultu
> re=neutral" %>
> <MM:Insert
> runat="server"
> CommandText='<%# "INSERT INTO dbo.contactquery (contact_name, email,
> question)
> VALUES (@contact_name, @email, @question)" %>'
> ConnectionString='<%#
> System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_con
> SQLPerenelle") %>'
> DatabaseType='<%#
> System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETY
> PE_conSQLPerenelle") %>'
> Expression='<%# Request.Form("MM_insert") = "frmAddrecord" %>'
> CreateDataSet="false"
> SuccessURL='<%# "contact-sucess.aspx" %>'
> FailureURL='<%# "contact-fail.aspx" %>'
> Debug="true"
> >
> <Parameters>
> <Parameter Name="@contact_name" Value='<%#
> IIf((Request.Form("txtName") <>
> Nothing), Request.Form("txtName"), "") %>' Type="NChar" />
> <Parameter Name="@email" Value='<%# IIf((Request.Form("txtEmail") <>
> Nothing), Request.Form("txtEmail"), "") %>' Type="NChar" />
> <Parameter Name="@question" Value='<%#
> IIf((Request.Form("txtComments") <>
> Nothing), Request.Form("txtComments"), "") %>' Type="NChar" />
> </Parameters>
> </MM:Insert>
> <MM ageBind runat="server" PostBackBind="true" />
>


Translate
Correct answer
June 8, 2006
Hi,

Yes I thought I had the updated .dll . Installed again and realisd that the extension was not overwriting the existing control on E:/ but installing into the shard data foldwer on C:/. Copied to Dramweaver and deployed and now working fine. Thanks...
Translate