Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
rjharris005 #1
Help with redirection page
I have created a .aspx form that employees use to submit suggestions.
I used asp:requiredfieldvalidation tags on all the fields and they worked fine
until I added a redirection page.
The redirection page was created in the insert record server behavior for the
form in question. If I remove the redirection page the form works correctly and
requires the fields contain data. If I have the redirrection page the tags are
ignored and the record is inserted.
Any ideas how to have both validation and redirection.
My code is attached.
<%@ Page Language="VB" ContentType="text/html" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,cultu
re=neutral" %>
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO dbo.bright_ideas (f_name, l_name, email, idea,
benefit) VALUES (@f_name, @l_name, @email, @idea, @benefit)" %>'
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_web
info") %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETY
PE_webinfo") %>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
SuccessURL='<%# "x_bright_ideas.aspx" %>'
Debug="true"<Parameter Name="@f_name" Value='<%# IIf((Request.Form("fname") <> Nothing),><Parameters>
Request.Form("fname"), "") %>' Type="NVarChar" />
<Parameter Name="@l_name" Value='<%# IIf((Request.Form("lname") <> Nothing),
Request.Form("lname"), "") %>' Type="NVarChar" />
<Parameter Name="@email" Value='<%# IIf((Request.Form("email") <> Nothing),
Request.Form("email"), "") %>' Type="NVarChar" />
<Parameter Name="@idea" Value='<%# IIf((Request.Form("idea") <> Nothing),
Request.Form("idea"), "") %>' Type="NText" />
<Parameter Name="@benefit" Value='<%# IIf((Request.Form("benefit") <>
Nothing), Request.Form("benefit"), "") %>' Type="NText" />
</Parameters>
</MM:Insert>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,cultu
re=neutral" %>
<MM:DataSet
id="new_hire_ds"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_web
info") %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETY
PE_webinfo") %>'
CommandText='<%# "select fname + " + Chr(39) + " " + Chr(39) + " + lname as
employee from dbo.emp where ({ fn month(doh) } = { fn Month(getdate()) }) and
({ fn year(doh) } = { fn year(getdate()) })" %>'
Debug="true"<MM:DataSet></MM:DataSet>
id="anniversaries_ds"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_web
info") %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETY
PE_webinfo") %>'
CommandText='<%# "SELECT fname + " + Chr(39) + " " + Chr(39) + " + lname AS
employee, { fn YEAR(GETDATE()) } - { fn YEAR(doh) } AS hyear, syear
= CASE WHEN { fn YEAR(GETDATE()) } - { fn YEAR(doh) } = 1 THEN " +
Chr(39) + " yr" + Chr(39) + " ELSE " + Chr(39) + " yrs" + Chr(39) + " END FROM
dbo.emp WHERE ({ fn MONTH(doh) } = { fn MONTH(GETDATE()) }) AND ({ fn
YEAR(doh) } < { fn YEAR(GETDATE()) })" %>'
Debug="true"<MM:DataSet></MM:DataSet>
id="birthday_ds"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_web
info") %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETY
PE_webinfo") %>'
CommandText='<%# "SELECT fname + " + Chr(39) + " " + Chr(39) + " + lname AS
employee, day(dob) AS bdate, dbay = CASE WHEN day(dob) = 1 THEN " +
Chr(39) + "st" + Chr(39) + " WHEN day(dob) = 2 THEN " + Chr(39) + "nd" +
Chr(39) + " WHEN day(dob) = 3 THEN " + Chr(39) + "rd" + Chr(39) + " ELSE
" + Chr(39) + "th" + Chr(39) + " END FROM dbo.emp WHERE ({ fn MONTH(dob) } =
{ fn MONTH(GETDATE()) })" %>'
Debug="true"<MM:DataSet></MM:DataSet>
id="announcements"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_web
info") %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETY
PE_webinfo") %>'
CommandText='<%# "SELECT dbo.annoucements.subject, dbo.annoucements.id FROM
dbo.annoucements WHERE dbo.annoucements.effective_date <= getdate() and
dbo.annoucements.end_date >= getdate()" %>'
Debug="true"<MM:PageBind runat="server" PostBackBind="true" />></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<link href="/mycss.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {font-size: medium}
.style2 {font-size: xx-small}
.style3 {font-size: x-small}
.style4 {
color: #FF9933;
font-weight: bold;
}
-->
</style>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><table width="800" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td width="10" background="/images/logo_col_lt.jpg"> </td>
<td width="50%" background="/images/logo_col_mdl.jpg"> </td>
<td width="485" nowrap="nowrap"
background="/images/logo_col_mdl.jpg"> </td>
<td width="10" background="/images/logo_col_rt.jpg"> </td>
</tr>
<tr>
<td width="10"> </td>
<td width="50%"><img src="/images/msi_logo_2.jpg" alt="f" width="300"
height="50" /></td>
<td width="50%" nowrap="nowrap"><div align="center" class="style1
style1">Healthcare Claims Management </div></td>
<td width="10"> </td>
</tr>
<tr>
<td width="10" bgcolor="#FF0000"> </td>
<td width="50%" bgcolor="#FF0000"> </td>
<td nowrap="nowrap" bgcolor="#FF0000"> </td>
<td width="10" bgcolor="#FF0000"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="590" align="left" valign="top"><p> </p>
<p align="center" class="style4">Bright Ideas Submission Form</p>
<p>Management beliefs that everyone in the company has valuable ideas
for improvement and is responsible for the companys health and
profitability.</p>
<p>If your idea is implemented you will receive $15.00.
</p>
<form action="" method='POST' name='form1' id="form1" runat='server'>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="17%" align="right">First Name </td>
<td width="83%"><asp:TextBox ID="fname" runat="server" />
<asp:RequiredFieldValidator ControlToValidate="fname"
EnableClientScript="false" ErrorMessage="First name is required!" ID="rfvfname"
runat="server" /></td>
</tr>
<tr>
<td align="right">Last Name </td>
<td><asp:TextBox ID="lname" runat="server" />
<asp:RequiredFieldValidator ControlToValidate="lname"
EnableClientScript="false" ErrorMessage="Last name is required!" ID="rfvlname"
runat="server" /></td>
</tr>
<tr>
<td align="right">E-mail Address </td>
<td><asp:TextBox ID="email" runat="server" />
<asp:RequiredFieldValidator ControlToValidate="email"
EnableClientScript="false" ErrorMessage="E-mail address is required!"
ID="rfvemail" runat="server" /></td>
</tr>
<tr>
<td align="right" valign="top">My Idea </td>
<td><asp:TextBox ID="idea" runat="server" TextMode="MultiLine"
Width="100%" Rows="5" /> <asp:RequiredFieldValidator ControlToValidate="idea"
EnableClientScript="false" ErrorMessage="Please enter your idea in the space
provided!" ID="rfvidea" runat="server" /></td>
</tr>
<tr>
<td align="right" valign="top">Benefit</td>
<td><asp:TextBox ID="benefit" runat="server" TextMode="MultiLine"
Width="100%" Rows="5" /> <asp:RequiredFieldValidator
ControlToValidate="benefit" EnableClientScript="false" ErrorMessage="Please
specify how this will benefit Med Shield!" ID="rfvbenefit" runat="server"
/></td>
</tr>
<tr>
<td align="right" valign="top"> </td>
<td> </td>
</tr>
<tr>
<td align="right" valign="top"> </td>
<td align="center"><asp:Button ID="Submit" runat="server"
Text="Submit" />
<div align="center"></div></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
</td>
<td width="210" align="center"><br />
<form name='form2' method='POST' >
<table width="210" border="0" align="center" cellpadding="0"
cellspacing="0">
<MM:If runat="server" Expression='<%# (new_hire_ds.RecordCount > 0)
%>'>
<ContentsTemplate>
<tr>
<td colspan="3" background="/images/bl_col_top.jpg"
class="white_letters">Please Welcome </td>
</tr>
<tr>
<td colspan="3" align="center"
background="/images/bl_col_mdl.jpg"><asp:DataGrid id="new_hire_dg"
runat="server"
AllowSorting="False"
AutoGenerateColumns="false"
BorderWidth="0"
CellPadding="3"
CellSpacing="0"
GridLines="Horizontal"
HorizontalAlign="Center"
ShowFooter="false"
ShowHeader="false"
DataSource="<%# new_hire_ds.DefaultView %>"
PagerStyle-Mode="NextPrev"
Width="98%"<HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD">
ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif"
Font-Bold="
rjharris005 Guest
-
Redirection of a page to domain root
Our search engine optimisation people have identified a double listing for index.cfm and the root domain of our site and have suggested a fix would... -
Page redirection in webservices ?
Hi , i have a webservice which has some methods and a login page.I 've connected the client to my webservice.now i want to redirect the user to... -
page redirection
Hi All, I found out that I can use the header function to redirect a page. However, it gives me an error like that: Warning: Cannot add... -
#25135 [Opn]: Strange redirection issue on missing page
ID: 25135 User updated by: kraj at illumen dot com Reported By: kraj at illumen dot com Status: Open Bug Type: ... -
#25135 [NEW]: Strange redirection issue on missing page
From: kraj at illumen dot com Operating system: FreeBSD 4.8 PHP version: 4.3.3RC4 PHP Bug Type: Apache related Bug...



Reply With Quote

