Solved

Get Data from DHTML Table in C#

Posted on 2006-06-14
11
228 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now