HighDots Forums  

Dynamic page to add to database table

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Dynamic page to add to database table in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RalphPaonessa
 
Posts: n/a

Default Dynamic page to add to database table - 12-04-2006 , 06:38 PM






I have a dynamically generated page of thumbnails from a database (DW8,
ASP/VBScript, SQL). I want to click on a thumbnail (or a button or link that
appears in each thumbnail div) and add the thumbnail to another table in my
database. What is an efficient and "elegant" way to code this in ASP?

Some options I've thought of:

1. Dynamically generate a Go To Detail Page link for each thumbnail. This
could pass the thumbnail ID to the detail page. I could then click on an Add
button on the detail page, or perhaps code the detail page so that it
automatically adds the thumnail to the table and then redirects back to the
calling page.

2. I could dynamically generate N forms for the N thumbnails. Each form would
have its own Add button and a hidden dynamically generated field with the
thumbnail ID. This should work, but it seems like a lot of redundant code (30
thumbs requires 30 forms). Also, should I dynamically name each form so I don't
get 30 "form1"s on the page?

3. I could create one form with N buttons; but not sure how to have each
button add only its corresponding thumbnail.

Any suggestions on how to do this in an efficient way? Also, does ASP.NET have
any "built-in" way of doing this sort of thing, that's so swift that I should
consider migrating to .NET?


Reply With Quote
  #2  
Old   
Paul Whitham AdobeCommunityExpert
 
Posts: n/a

Default Re: Dynamic page to add to database table - 12-04-2006 , 07:58 PM






I would go with option 1, however all you would need is a page containing an
ASP script, rather than a separate form and button. Handle the insert as
soon as the page loads, and then redirect back.

In terms of ASP.Net you could handle the whole lot inside of a single page
using a selectable datalist. Whether is is any more elegant or efficient as
the ASP option is debatible.




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

Valleybiz Internet Design
www.valleybiz.net

"RalphPaonessa" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
I have a dynamically generated page of thumbnails from a database (DW8,
ASP/VBScript, SQL). I want to click on a thumbnail (or a button or link
that
appears in each thumbnail div) and add the thumbnail to another table in
my
database. What is an efficient and "elegant" way to code this in ASP?

Some options I've thought of:

1. Dynamically generate a Go To Detail Page link for each thumbnail. This
could pass the thumbnail ID to the detail page. I could then click on an
Add
button on the detail page, or perhaps code the detail page so that it
automatically adds the thumnail to the table and then redirects back to
the
calling page.

2. I could dynamically generate N forms for the N thumbnails. Each form
would
have its own Add button and a hidden dynamically generated field with the
thumbnail ID. This should work, but it seems like a lot of redundant code
(30
thumbs requires 30 forms). Also, should I dynamically name each form so I
don't
get 30 "form1"s on the page?

3. I could create one form with N buttons; but not sure how to have each
button add only its corresponding thumbnail.

Any suggestions on how to do this in an efficient way? Also, does ASP.NET
have
any "built-in" way of doing this sort of thing, that's so swift that I
should
consider migrating to .NET?




Reply With Quote
Reply




Thread Tools
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 On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.