Solved

Get Data from DHTML Table in C#

Posted on 2006-06-14
11
230 Views
Last Modified: 2010-04-16
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
Comment
Question by:deandany
  • 4
  • 4
11 Comments
 
LVL 7

Expert Comment

by:mjmarlow
ID: 16910072
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
 

Author Comment

by:deandany
ID: 16912490
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
 

Author Comment

by:deandany
ID: 16943327
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 7

Expert Comment

by:mjmarlow
ID: 16944833
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
 

Author Comment

by:deandany
ID: 16954001
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
 

Author Comment

by:deandany
ID: 17032367
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
 
LVL 7

Expert Comment

by:mjmarlow
ID: 17043388
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
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 17047281
Closed, 300 points refunded.

GhostMod
Community Support Moderator
0
 
LVL 7

Expert Comment

by:mjmarlow
ID: 17049932
Ok.  Thanks for the feedback.  I will keep that in mind next time.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Turn on intranet settings 1 56
PrintingFoundIt(Almost!(Damn!)) 1 27
VB.NET 2008 - SQL Timeout 9 24
Winforms -- Capture CTRL+SHIFT+D at the form not working? 3 20
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question