Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7438111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:30:14+00:00 2026-05-29T10:30:14+00:00

I have an apsx page in the asp.net application, elements of which are built

  • 0

I have an apsx page in the asp.net application, elements of which are built using javascript according to the user’s input. When the user clicks the “Save” button I need to create a file on the server with all the data provided by the user. The problem is that this data is stored in the javascript(in the generated divs). I need somehow to get this data into the asp.net button click function or call the function with all the data as arguments. How can it be implemented?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:30:14+00:00Added an answer on May 29, 2026 at 10:30 am

    You can always try and pop the data you need in hidden input fields on the form, so you can access it with Request.Form["fieldName"] (just remember to give the hidden input fields a “name” attribute, else you’ll spend an unnecessary amount of hours trying to figure out why you can’t access it via Request.Form :P) from the code-behind. That’s probably the easiest way to achieve this…

    EDIT

    Just to give you a quick idea, here’s some sample code from one of my projects where I generate hidden inputs fields based on certain dynamic fields to post back to the server once the Save() function is called from certain buttons / anchors:

    function Save() {
        $("div.fieldcontainer span.readonly").each(function () {
            var fieldId = $(this).attr("id");
            var fieldValue = $(this).html();
            var ctrl = $("<input type=\"text\" id=\"" + fieldId + "\" name=\"" + fieldId + "\" style=\"display:none;\" />");
            ctrl.val(fieldValue);
            $(this).parent().append(ctrl);
        });
        $("div.fieldcontainer a.attachment").each(function () {
            var fieldId = $(this).attr("id");
            var fieldValue = $(this).text() + "|" + $(this).attr("href");
            var ctrl = $("<input type=\"text\" id=\"" + fieldId + "_txtHiddenValue\" name=\"" + fieldId + ":txtHiddenValue\" style=\"display:none;\" />");
            ctrl.val(fieldValue);
            $(this).parent().append(ctrl);
        });
        $("div.fieldcontainer select").each(function () {
            var fieldId = $(this).attr("id");
            var fieldValue = $(this)[0].value;
            var fieldText = $(this).find("option[value='" + fieldValue + "']").text().replace("<", "").replace(">", "");
            $(this).attr("id", fieldId + "_ORIGINAL");
            var ctrl = $("<input type=\"text\" id=\"" + fieldId + "\" name=\"" + fieldId + "\" style=\"display:none;\" />");
            ctrl.val(fieldText + "$" + fieldValue);
            $(this).parent().append(ctrl);
        });
        $("div.fieldcontainer input[type='checkbox']").each(function () {
            var fieldId = $(this).attr("id");
            var fieldValue = $(this).attr("checked");
            $(this).attr("id", fieldId + "_ORIGINAL");
            var ctrl = $("<input type=\"text\" id=\"" + fieldId + "\" name=\"" + fieldId + "\" style=\"display:none;\" />");
            ctrl.val(fieldValue);
            $(this).parent().append(ctrl);
        });
        document.form1.submit();
    }
    

    You can possibly implement the same type of logic to cycle through each of your client-generated DIVs and create a hidden input for each before submitting the form. That way you don’t unnecessarily bog down the page with too much extra markup while the user is busy interacting with it…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have just started converting an existing job tracking system into an ASP.NET MVC application.
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have started playing with Xcode 4.2, and created a single page application using storyboard
I have a apsx page and in that page I have two buttons called
So I have an apsx page with 2 buttons at the top and an
i have two popup windows in my Home Page (Default.aspx) like below : apsx
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
I have a problem in asp.net I'm developing a website in visual studio 2008
Have just started using Google Chrome , and noticed in parts of our site,
i have a MVC application that works fine; but now i need to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.