Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Get Data from DHTML Table in C#

Posted on 2006-06-14
11
Medium Priority
?
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

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.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

609 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