• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

Get Data from DHTML Table in C#

Project: Shopping cart
Sorry my question is not going to be concise.
This is a masters screen done using C# for data retirval and Javascript/DHTML/CSS for Gui. Since the masters screen is like any registration screen with a submit button retrieval is not an issue. My problem is when i want to retrieve a Detail for the Master table. My master is a Kit Master which has a many to many relationship with Product Master.Till Now have displayed only Kit master. Now we need to display a Detail in the same screen where from a product list box admin can push products to a HTML Table next to it and enter no of units of that item which is available in that Kit(Kit is like a package of more than one products like a gift cracker box of assorted items). The HTML table is going to be a dynamic one and hence its elements will have an ID associated with it at client-side using JS. when i submit FORM i want to capture the Table and its data as a collection, loop thru it and insert each row as a row in Kit Details table. But Httpcontext.Current.Request.Form allows variables to be directly called. But my form variables forTABLE are dynamic. So i have 2 questions. Is my idea of implementation right?
I have posted a screenshot (kits.jpg) in Kits album of my screen in following Link
http://pg.photos.yahoo.com/ph/dinesh_r_y2k/album?.dir=/5c44re2&.src=ph&.tok=ph3nwBFBRHzt0huo
Or try
http://photos.yahoo.com/dinesh_r_y2k 
and then select Kits album
Thanks in advance
0
deandany
Asked:
deandany
  • 4
  • 4
1 Solution
 
mjmarlowCommented:
HTML table does not post (send) information back to server when form is submitted.  INPUT elements do.  So, if you are dead set in using a table to present, you need to have hidden INPUT(s) on the page.  When you populate the table with your javascript, also populate the hidden INPUT elements.  When the form is posted, the data stored in the hidden INPUT elements will be delivered to server.
0
 
deandanyAuthor Commented:
thanks mjmarlow.
But i asked how to get hold of the INPUT Elements in a generic manner. There may be a Hidden Input element ID TXT1, TXT2, TXT3.... How do i know how many TXT(s) IDs are available???? I want to write something like this
[I may (and am) sound kiddish but i am stuck here]

For i = 1 to TXT(s)
   var1 = Request.form[TXT(i)]
   insert into tbl1 values('+var1+')
Next

Is there any possible like this... If TXT prefix is for Product Name, then i must be able to iterate thru all products using this prefix... Am i talking sense? or can u suggest any other way in which rows of non-editable detail can be shown wihtout using DataGrids in JS
Thanks
0
 
deandanyAuthor Commented:
Just now i realised the difficulty level of my requirement and hence am doubling the Points. This includes  Suggestion of a new method to accomplish this Master-Detail using JS,Without Server COntrol like DataGrid
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
mjmarlowCommented:
Use client side javascript to store all of your items in the SINGLE HIDDEN input element.  Delimit the contents in the HIDDEN element and split the results on the server side using string.split() method.
0
 
deandanyAuthor Commented:
Could u be more elobarate... And can u provide some links where some samples are provided where data in HTML table are saved in Database... I think i am not the first one to do this ;-)

be happy
-Dany
0
 
deandanyAuthor Commented:
Hi Experts,

    I accept the question by itself was a very vague and open ended question... only one member stuck to it. But the solution he gave was elementary and i needed an advanced solution... i had also asked for a better solution and since then no one replied in spite of me doubling the points... I think i have been very clear... and i cannot give more points than what i have fixed.. becos i am in no urgency to receive an asnwer and the solution i expect is a methodology rather than actual code as solution....
I hope everyone understands the situation and reacts

be happy,
Dany
0
 
mjmarlowCommented:
The question was indeed vague and non conventional.  In time i suspect that asker will yield to more conventional techniques for accomplishing his requirement.  This was not part of the question.  I think that I did provide a methodology/technique for accomplishing what was requested.   This forum is for exchanging ideas and teaching - not writing code.  If the asker sees no value in what i have offered i do not think it is based on the value of the information provided - instead it is a reflection on the askers value system for obtaining advice.

So in my opinion, i would ask the "judge" to read my advice and deem it a worthy solution to the request and for the asker to try things out rather than expect others to do the work for them.

At least next time the asker should state what they are looking for (advice, code, links, completed project) so an expert can know what they are getting into.  
0
 
GhostModCommented:
Closed, 300 points refunded.

GhostMod
Community Support Moderator
0
 
mjmarlowCommented:
Ok.  Thanks for the feedback.  I will keep that in mind next time.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now