Solved

Get Data from DHTML Table in C#

Posted on 2006-06-14
11
233 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

691 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