Solved

Building form data loically and then transferring to server help

Posted on 2013-06-02
6
238 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
  • 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

778 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