.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Data lost on submit

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

Dear Experts,

I have a modal popup and a GridView in it. The GridView is populated programmatically, i.e. I use .DataBind(). I can enter data into some of the GridView's controls. After I press Submit, I expect to do something with the entered data. But in the button press handler, the GridView is empty. I realize that I have to DataBind() again in the handler, but how can I preserve the data the user enters?


View Complete Post

More Related Resource Links

WSS 3.0 Content Type - Lost data for Titles


We are running WSS 3.0 SP2 on server 2003.  Recently, we lost the "Titles" for all content types for documents.  Our system Content Type for Document is set up to require this field to be completed on all documents that is uploaded.  Our system would automatically enter in by default the name of the document in the "Title" field it no longer does this for the user.  The user must now enter in manually the "Title".  How do I get it to enter in the "Title" using the document file name automatically?

Below is the way the setting page for Site Content Type: Document looks like.  (I tried to recreate it since I could place a screen shot in the box)

Site Content Type Information
Name:  Document
Descriptiong:  Create a new document.
Parent:  Item
Group:   Document Content Types

Name, Description, and group
Advanced settings
Workflow settings
Delete this site content type

Name                 Type                     &nb

Changing aspx page causes session data to be lost...


Strange but true. Any ideas what might be causing this?


Wizard Control textbox data is lost

I'm using a wizard contol with several textbox fields. I have two textbox fields disabled (textbox19 and textbox20)because I don't want the user to change the values that are calculated from the other textboxes (see javascript below). I do this with javascript on the clientside. My problem occurs when the user is in STEP2 and goes back to STEP1 the values in the disabled fields are gone. Is there a way to fix this? I would also like to perform a validation on textbox20 but I haven't been able to do that with the textbox disabled. How can I do validations on a field that is disabled? I've tried enabling the fields and using readonly = true but that doesn't work either. Any suggestions? // Client Side script to do calculations <script type="text/javascript">       function calculateSubTotal() {      var txt6 = document.getElementById('<%= TextBox6.ClientID %>');     var txt12 = document.getElementById('<%= TextBox12.ClientID %>');     var txt18 = document.getElementById('<%= TextBox18.ClientID %>');     var txt14 = document.getElementById('<%= TextBox14.ClientID %>');     var txtSubTotal = document.getElementById('<%= TextBox19.Cl

Infopath Data Connections and Submit

We are in the process of shifting our draft system from SP 2007 to SP 2010 and we are re-visiting our Infopath forms service. Admin approved IP forms,  the templates emailed to our 12 remote 'offices' 12 Site collections -identical structure for remote locations 12 Remote user locations, never connected! ,fills in the form, selects own site, and emails back to office Custom button on form with rules reads 'selected site' and uses appropiate data connection to submit to correct Site Collection/Form Library. We are only using 1 site at the moment but obviously with 12 sites it becomes unmanagable, my thoughts;- Can we use a web service to act as an intermediary to point to correct library? Would a dataconnection library help?, or is the amount of work the same? ??? casey  

make anonymous users submit data to a form library

isn't there a way for anonymous users to submit form data to a form library without custom code?

How to submit data to a SQL Server database table from a custom page ?

Using SPD, I have created a custom page. It has a form with ASP.NET controls textbox, radio buttons, dropdown, submit button etc., Also, I created a Database connection (to the SQLServer database table) under Database Connections. But not sure how to connect this form to the database connection so that when form data is submitted, the data will be inserted into the table.

excel to gridview, lost data?!

I don't know why.... I can't understand I import by fileupload one xls, I open this one and I would connect it to a gridview.Everythings works fine but when I see the gridview I don't understand why some data is not available  HttpPostedFile xls = this.FileUpload1.PostedFile; string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + xls.FileName.ToString() + ";Extended Properties=Excel 8.0"; DataTable dt = new DataTable(); DataSet ds = new DataSet(); OleDbConnection oConn = new OleDbConnection(); oConn.ConnectionString = strConn; oConn.Open(); List<string> fogli = new List<string>(); //recupero i nomi dei fogli del file excel dt = oConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,null); foreach (DataRow tt in dt.Rows) { fogli.Add(tt["TABLE_NAME"].ToString()); } dt.Clear(); System.Data.OleDb.OleDbDataAdapter ExcelAdapter = new System.Data.OleDb.OleDbDataAdapter("SELECT * FROM [" + fogli[162].ToString() + "]", oConn); ExcelAdapter.Fill(ds); gvExcel.DataSource = ds.Tables[0].DefaultView; gvExcel.DataBind();First I get the name of all the sheets and after I fill one

a way to submit data from ssrs to database and commit?

Hi, I want to know a way to submit data from ssrs to database and commit? if yes, how? Thank you Francis sZEfsze88

do not use datagrid or form view , how can i submit data from webform to..

please help me , if i do not want to use datagrid , formview, or gridview , because it s not work with some of my script,  please hel me to submit data from 50 textbox to data base (sql2008) i really need it . thank you sorry for my enghlish

data lost in transition from view->controller


MVC basics or looks like I am doing something terribly wrong, but have not slightly idea what is it?

Want to delete user from MVC Framework's Built in Security Module.

So first I define Delete() in AccountController:

        public ActionResult DeleteUser()


            User_Repository urp = new User_Repository();

            aspnet_Users currUser = urp.Get_AspNet_User(HttpContext.User.Identity.Name);

            return View(currUser);


and this works fine.


I added view (for delete) DeleteUser.aspx


<h3>Are you sure you want to delete this?</h3>




        <div class="display-label">UserId</div>

        <div class="display-field"><%= Html.Encode(Model.UserId) %></div>


        <div class="display-label">UserName</div>

        <div class="display-field"><%= Html.Encode(Model.UserName) %>&

create an infopath form that receive and submit data to sql server database in the same form



i want to create an infopath form that can receive the data out of the slq server database and edit the data in the database and then submit it.

here is what i did so far.

i created a data connection to a sql server database to SUBMIT the data.

also i created a data connection to the same sql server database to RECEIVE the data.

when i open the form the user and the user's details are already filled in the form, now i need to let the user edit the data in the fields or add a new data in a field and then the form need to be submitted to a temporary database to be checked first by an approver and after approval the form must be submitted to the real sql server database.

i tought about that the approver just need to click a button and the data will be submitted to the the real database.

both the temporary and the real database has the same tables and fields.

i just need to know how to edit and submit the data to the temporary later to the real database



How to submit data from repeating table to an SAP web service


Hi ,

                 I am new to infopath. I have a porblem here while submitting data from a repeating table to an SAP web service to insert data into the fields in the web service. Can any one suggest me how to submit data from a repeating table to SAP using an SAP web service. I need to use a web service which is created by SAP group. My job is to map the fields in table and in the web service. SAP web service contains a table which can get the data from our repeating table. Any help would be greatly appreciated. If you are confused with my question please let me know.



Submit Data to SQL Server?

I have infopath 2010, MOSS 2007, and sql server 2008. I can receive data from a database on sql server to populate a drop down list on my form, and this works fine. My problem is that I want to make a simple form so that the accounting department can add to a table in the database as they need to. They can't just have access to sql server to do this in case they don't know what they are doing. I designed the form from the database table, but I do not see any option for submitting the data back to the same table, or to any database at all for that matter. There has to be a way to do this Im sure. Does anybody have an idea?

InfoPath 2010 master details form, Submit data to muliple Form Library

I have 2 Form library
Library 1 :
    Employee ID
    Employee Name
    Employee Age
Library 2 :
    Employee ID

I want to create one form using Info Path as master details form. i.e for Library 2 repeating field.
How we can do this any one have any idea.

I have tried to submit this form data into 2 data connection in info path, but its not working ....

Tabpanel data lost


I have two tab panels and each tab panel has a text box.  When I move between the tabs, the data in the text boxes is lost.  What should I do to retain the data?

Will it be a good practice to submit form data through web service method?



I am trying to submit my form's data to database using asmx Web Service method(Through AJAX extension methods i.e., Script callback method). My form contains lot of data, though only text data.This will be a very fast process,but still i want to get some advice from you expert persons that should i processd in the same way ?Or should i submit form data in the traditional way ?

Please give proper reason for your answer.

lost updated data after form is closed



I have a form thru which I add new user and/or edit users list. Adding a new user is okay. Edited data is also saved with the update tableadapter.update method, but as soon as I close the form, the data is set back to the original values. (However new records are there). Data is stored on table "Users", which is part of the "Database.sdf".


Please help, how can I save/update the values for existing items.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend