Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Millsaps #1
ASP.NET C# InsertRecordSuccessPage How to display infofrom new record just added
Using ASP.NET C#, assume that I have just added a record via a page called
InsertRecord.aspx which then goes to a page called InsertRecordSuccess.aspx.
The plan is to have this page InsertRecordSuccess.aspx show "Successfully added
this record" and then on that same page show all the data for the new record
just added. I have tried for about 3 weeks to fix this problem. Could you
provide me information as to how I can accomplish this?
Here is the InsertRecordSuccess.aspx page followed by the InsertRecord.aspx
ConsultantsAddSuccess.aspx
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,cultu
re=neutral" %>
<MM:DataSet
id="Consultants"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings["MM_CONNECTION_STRING_Uni
fourPeds"] %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings["MM_CONNECTION_DATABASETY
PE_UnifourPeds"] %>'
CommandText='<%# "SELECT * FROM dbo.Consultants WHERE ConsultantID=" +
Request.QueryString["ConsultantID"] %>'
Debug="true"<MM:PageBind runat="server" PostBackBind="true" />></MM:DataSet>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Success Adding Consultant Record</title>
<style type="text/css">
<!--
.style1 {
font-size: large;
font-weight: bold;
}
.style6 {font-size: small}
.style4 {color: #0000FF}
.style7 {
color: #0066FF;
font-style: italic;
}
-->
</style>
</head>
<body>
<div align="center"><span class="style1"><u>Success</u> in adding this new
consultant name and information!</span><br>
<a href="Consultants.aspx">Return to consultant list</a> ... <span
class="style6"><span class="style4">(<a
href="ConsultantsEdit.aspx?ConsultantID=<%#
Consultants.FieldValue("ConsultantID", Container) %>">Edit this Specialist
Record)</a> </span></span></div>
<table width="700" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<th width="200" valign="top" scope="col"><div align="right">Practice Name
(and ID#):</div></th>
<th width="3" scope="col"> </th>
<th width="497" scope="col"><div align="left"><a href="<%#
Consultants.FieldValue("Practice", Container) %>"><%#
Consultants.FieldValue("Practice", Container) %></a> ( <%#
Consultants.FieldValue("ConsultantID", Container) %>)</div></th>
</tr>
<tr>
<td valign="top"><div align="right">Providers:</div></td>
<td> </td>
<td><div align="left"><%# Consultants.FieldValue("Providers", Container)
%></div></td>
</tr>
<tr>
<td valign="top"><div align="right">Specialty:</div></td>
<td> </td>
<td><div align="left"><%# Consultants.FieldValue("Specialty", Container)
%></div></td>
</tr>
<tr>
<td valign="top"><div align="right">Ages Seen: </div></td>
<td> </td>
<td><%# Consultants.FieldValue("PedOrGeneral", Container) %> <span
class="style7">(Pediatric, General, or Adult)</span></td>
</tr>
<tr>
<td valign="top"><div align="right">Local or Distant: </div></td>
<td> </td>
<td><%# Consultants.FieldValue("LocalOrDistant", Container) %> <span
class="style7">(Local or Distant or Unknown)</span></td>
</tr>
<tr>
<td valign="top"><div align="right">Main Phone (public): </div></td>
<td> </td>
<td><div align="left"><%# Consultants.FieldValue("PhoneMain", Container)
%></div></td>
</tr>
<tr>
<td valign="top"><div align="right">Private Phone (non-public) </div></td>
<td> </td>
<td><div align="left"><%# Consultants.FieldValue("PhonePvtMain",
Container) %></div></td>
</tr>
<tr>
<td valign="top"><div align="right">Main FAX </div></td>
<td> </td>
<td><div align="left"><%# Consultants.FieldValue("FAXMain", Container)
%></div></td>
</tr>
<tr>
<td valign="top"><div align="right">Location Details and Other:</div></td>
<td> </td>
<td><div align="left"><%# Consultants.FieldValue("LocationAndMisc",
Container) %></div></td>
</tr>
<tr>
<td valign="top"><div align="right">Address</div></td>
<td> </td>
<td><div align="left"><%# Consultants.FieldValue("StreetAdrMain",
Container) %>, <%# Consultants.FieldValue("CityMain", Container) %>, <%#
Consultants.FieldValue("State", Container) %> <%#
Consultants.FieldValue("ZipMain", Container) %></div></td>
</tr>
<tr>
<td valign="top"><div align="right">Dept Web Site: </div></td>
<td> </td>
<td><div align="left"><a href="<%# Consultants.FieldValue("URL",
Container) %>"><%# Consultants.FieldValue("URL", Container) %></a></div></td>
</tr>
<tr>
<td valign="top"><div align="right">MapQuest Location </div></td>
<td> </td>
<td><div align="left"><%# Consultants.FieldValue("LocationStreet",
Container) %>, <%# Consultants.FieldValue("LocationCity", Container) %>, <%#
Consultants.FieldValue("LocationState", Container) %>, <%#
Consultants.FieldValue("LocationZip", Container) %></div></td>
</tr>
<tr>
<td valign="top"><div align="right">Other Information for Saff Only:
</div></td>
<td> </td>
<td><div align="left"><%# Consultants.FieldValue("StaffOnly", Container)
%></div></td>
</tr>
</table>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>
and here is the ConsultantsAdd.aspx page:
<%@ Page Language="C#" Debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,cultu
re=neutral" %>
<script language="c#" runat="server">
public string GetIDParameter( DreamweaverCtrls.Insert obj )
{
string strDebug = "1";
try
{
if( obj == null )
{
return( "InsertObjectnull" );
}
try
{
System.Data.DataView dv = obj.DefaultView;
}
catch
{
return( "NullReferenceException" );
}
return( "14" );
// return( Convert.ToString( obj.DefaultView.Table.Rows[0].ItemArray[0] ) );
strDebug = "2";
if( obj.ParameterValue( "@ID" ) == null )
{
return( "PV==null" );
}
strDebug = "3";
return( Convert.ToString( obj.ParameterValue( "@ID" ) ) );
}
catch( Exception ex )
{
return( strDebug + ex.Message.ToString() );
}
}
</script>
<MM:Insert
runat="server"
id="d"
CommandText='<%# "set nocount on; INSERT INTO dbo.Consultants (Specialty,
PedOrGeneral, LocalOrDistant, Practice, PhoneMain, PhonePvtMain, FAXMain,
Providers, LocationAndMisc, StaffOnly, StreetAdrMain, CityMain, \"State\",
ZipMain, URL, LocationStreet, LocationCity, LocationState, LocationZip, Prov,
Phar, DME, Gov) VALUES (@Specialty, @PedOrGeneral, @LocalOrDistant, @Practice,
@PhoneMain, @PhonePvtMain, @FAXMain, @Providers, @LocationAndMisc, @StaffOnly,
@StreetAdrMain, @CityMain, @State, @ZipMain, @URL, @LocationStreet,
@LocationCity, @LocationState, @LocationZip, @Prov, @Phar, @DME, @Gov); select
@ID=@@IDENTITY; set nocount off" %>'
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings["MM_CONNECTION_STRING_Uni
fourPeds"] %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings["MM_CONNECTION_DATABASETY
PE_UnifourPeds"] %>'
Expression='<%# Request.Form["MM_insert"] == "form1" %>'
CreateDataSet="true"
SuccessURL='<%# "ConsultantsAddSuccess.aspx?ConsultantID=" + GetIDParameter( d
) %>'
FailureURL='<%# "ConsultantsAddSuccess.aspx?ConsultantID=" + GetIDParameter( d
) %>'
Debug="true"<Parameters>>
<Parameter Name="@Specialty" Value='<%# ((Request.Form["Specialty"] !=
null) && (Request.Form["Specialty"].Length > 0)) ? Request.Form["Specialty"] :
"" %>' Type="NVarChar" />
<Parameter Name="@PedOrGeneral" Value='<%# ((Request.Form["PedOrGeneral"]
!= null) && (Request.Form["PedOrGeneral"].Length > 0)) ?
Request.Form["PedOrGeneral"] : "" %>' Type="NVarChar" />
<Parameter Name="@LocalOrDistant" Value='<%#
((Request.Form["LocalOrDistant"] != null) &&
(Request.Form["LocalOrDistant"].Length > 0)) ? Request.Form["LocalOrDistant"] :
"" %>' Type="NVarChar" />
<Parameter Name="@Practice" Value='<%# ((Request.Form["Practice"] != null)
&& (Request.Form["Practice"].Length > 0)) ? Request.Form["Practice"] : "" %>'
Type="NVarChar" />
<Parameter Name="@PhoneMain" Value='<%# ((Request.Form["PhoneMain"] !=
null) && (Request.Form["PhoneMain"].Length > 0)) ? Request.Form["PhoneMain"] :
"" %>' Type="NVarChar" />
<Parameter Name="@PhonePvtMain" Value='<%# ((Request.Form["PhonePvtMain"]
!= null) && (Request.Form["PhonePvtMain"].Length > 0)) ?
Request.Form["PhonePvtMain"] : "" %>' Type="NVarChar" />
<Parameter Name="@FAXMain" Value='<%# ((Request.Form["FAXMain"] != null)
&& (Request.Form["FAXMain"].Length > 0)) ? Request.Form["FAXMain"] : "" %>'
Type="NVarChar" />
<Parameter Name="@Providers" Value='<%# ((Request.Form["Providers"] !=
null) && (Request.Form["Providers"].Length > 0)) ? Request.Form["Providers"] :
"" %>' Type="NVarChar" />
<Parameter Name="@LocationAndMisc" Value='<%#
((Request.Form["LocationAndMisc"] != null) &&
(Request.Form["LocationAndMisc"].Length > 0)) ? Request.Form["LocationAndMisc"]
: "" %>' Type="NVarChar" />
<Parameter Name="@StaffOnly" Value='<%# ((Request.Form["StaffOnly"] !=
null) && (Request.Form["StaffOnly"].Length > 0)) ? Request.Form["StaffOnly"] :
"" %>' Type="NVarChar" />
<Parameter Name="@StreetAdrMain" Value='<%#
((Request.Form["StreetAdrMain"] != null) &&
(Request.Form["StreetAdrMain"].Length > 0)) ? Request.Form["StreetAdrMain"] :
"" %>' Type="NVarChar" />
<Parameter Name="@C
Millsaps Guest
-
How can I display daily record?
Hi.. How can I display daily record for one month? I have to make in main page daily subject and details, for any day it well display different... -
last record doesn't display
http://www.middletree.net/debug/DisplaySortableTickets.html Doing an Intranet-based app in ASP. I put the view source version (that is, no ASP... -
using dropdown box to display db record & update record
Hi Folks, I have a web database written in asp and using access97. I have many projects, but each project is being held responsible by a person.... -
Display whole record
The best way to do this is to use an unbound combo (one with nothing in its Control Source property) for navigation. Details:... -
Detect new record being added but not saved yet
No Spam wrote: Rather than looking for and allocating the number at the start, try doing this as the very last thing as your new record is...



Reply With Quote

