Solved

Building form data loically and then transferring to server help

Posted on 2013-06-02
6
260 Views
Last Modified: 2013-06-17
Hi all,

I have a asp.net website whereby a user will build a form.

Once they have built the form I want to then save it to a db on the server.

I have created persistant classes for the tables in the db.

Now I would like to build the object as the user builds the form client side (or by AJAX?). Once the user has finished nd they click save I would like to commit to the database.

Can anyone give any advice on the best way to do this?

We have considered building persistant classes in javascript or jquery and then sending this over to the server?

Also if this is the best way to go are there any programs that will automatically build the persistant classes in javascript?

thanks in advance.

Matt.
0
Comment
Question by:flynny
[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
  • 2
  • 2
  • 2
6 Comments
 
LVL 1

Expert Comment

by:CM2013
ID: 39214758
Just use C# to commit it to the database OnSubmit(). IS that what you are asking?
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 39214830
You could use Serialization/Deserialization for your purpose. You could save the object in to a database and as stream and you can create the objects from the stream again. In your case I hope Binary Serialization would work. As Form is as well a class you could choose this approach.

http://www.codeproject.com/Articles/36781/Serialization-and-Deserialization-in-ASP-NET-with
http://www.youtube.com/watch?v=vQZAO_BLzoU
http://www.youtube.com/watch?v=URw86vBWeGE
http://www.centerspace.net/examples/nmath/csharp/core/binary-serialization-example.php

However you could refer other serialization methods as well:

http://support.microsoft.com/kb/815813
http://www.centerspace.net/examples/nmath/csharp/core/soap-serialization-example.php
0
 

Author Comment

by:flynny
ID: 39215570
CM2013,

Thanks for this. Would the building of the form be fluid?

As I guess with this method for example when I add a section to the form (as a class), this would contact the server add it and then reload the page?

On submit button would then just read the class to the database?  

Do you have some example code on doing this please? Or is it as simple as for example adding a 'add section' button with a server side click which adds a section to the structure and html to the page?

EaswaranP

Thanks for this how would this impact search the db though? i guess witht he object serialise din the db it would be pretty impossible?
0
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 39215731
By adding new field there is no issue. You have to update the existing data in DB accordingly.
In this case you can go for XML Serialization. Having XML data in db. If you add or remove any field then update the db column accordingly.

HTH.
0
 

Author Comment

by:flynny
ID: 39215841
Ok i see thanks for this.

Regarding transferring it across from clien to server side (preferrably ajax) how woul dyou recommend doing this pleasE?

Regards,

Matt
0
 
LVL 1

Accepted Solution

by:
CM2013 earned 500 total points
ID: 39216602
Matt, you're quite humble :)

Did you try using Formview?

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/formview.aspx

I can post an example, let me know. There are plenty in the web as well.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

632 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