p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Web Programming > Adobe Web Programming > Dreamweaver (all versions)
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 7th, 2005, 04:55 PM
Registered User
 
Join Date: Jul 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default automatically update or insert record

I was wondering if it is possible to automatically update or insert a record after executing a function by using the dreamweaver mx update record behavior, but without using any server side control (without the user clicking a submit button or any other command). This web page will only request two cookies and insert the value on a table.

I have try different ways but it seems that the values of my hiddenforms that I use to insert the records are deleted before executing the Insertar.Expression.Doinit()

This is what I am doing:

''''''''''This is my insert record behavior code
<MM:Insert
runat="server"
id="insertar"
CommandText='<%# "INSERT INTO dbo.Waist (WaistID, Waist) VALUES (@WaistID, @Waist)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_TMDatabase") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETYPE_TMDatabase") %>'
Expression="false"
CreateDataSet="false"
SuccessURL='<%# "index.htm" %>'
Debug="true"
><Parameters>
  <Parameter Name="@WaistID" Value='<%# IIf((Request.Form("hf_PID") <> Nothing), Request.Form("hf_PID"), "") %>' Type="BigInt" />
  <Parameter Name="@Waist" Value='<%# IIf((Request.Form("hf_PID2") <> Nothing), Request.Form("hf_PID2"), "") %>' Type="Int" />
</Parameters>
</MM:Insert>

'''''This is where I initialize the cookies
<script runat="server">
Public PatientID as HttpCookie
Public waist2 as HttpCookie
Public wasitstring as string

Sub Page_Init(Src As Object, E As EventArgs)
PatientID = request.Cookies("pPatientID")
waist2 = request.Cookies("pWaist")
End Sub
</script>

'''''This is where I assigne the cookies to a hidden form and then call the INSERT behavior to insert the values to the database
<script runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
hf_PID.Value= PatientID.value
hf_PID2.Value = waist2.value

Label1.Text = Cstr(hf_PID.Value) + Cstr(hf_PID2.Value)

insertar.Expression = "true"
insertar.DoInit()
insertar.Expression = "false"

End Sub
</script>


--------------------------------------------------------------------------------


I have also tried to put all the code under the Sub Page_Load(Src As Object, E As EventArgs) or Sub Page_Prerednder(Src As Object, E As EventArgs) functions but nothing happens.

If I use the UPDATE RECORD BEhavior instead of the INSERT RECORD, it will take me to the success page but without updating the hidden forms values on the database.

Do you have any suggestions? DoI need to include something else besides insertar.Expression = "true" ?

Thank you,


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically update the version of AssemblyInfo piyushnu C# 0 April 14th, 2006 07:17 AM
How to insert row no automatically Jane SQL Server 2000 1 January 13th, 2006 12:20 PM
ASP.net Datgrid update and asp.net insert record Lofa ASP.NET 1.1 0 August 24th, 2005 03:58 AM
Automatically update all fields [Word 2003] devstylex Access VBA 2 February 2nd, 2005 08:46 AM
Update Source Record After Insert Duncan Allen SQL Server DTS 1 October 25th, 2004 11:44 AM



All times are GMT -4. The time now is 06:13 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc