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

Top 5 Contributors of the Month
Imran Ghani

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

ASP.Net Dynamic Data : How to carry on data?

Posted By: CarlosPorras.sv     Posted Date: October 16, 2010    Points:2   Category :ASP.Net
Hola (means Hello in Spanish),

I wish to know if anyone knows the say in which data could be passed between two consecutive Insert data operations?

To be more clear: I'd like to create a "Bulk Insert" feature in my system, meaning that if you just entered a new record then you wouldn't be talking back again to the List.aspx page but rather staying in the very same Insert pages in which you have entered the new record.

Then, I'd like to reset all other values to null except those pertaining to the dropdownlists that were already selected in the previous entry.

For instance: if you are entering data into a catalog of products and you have already selected items (foreign keys) as provider, store, dept, section, line, type of product, type of package, brand name, and so fort ... WHICH OF COURSE WILL BE VARY VALUEBAL NOT TO BE HAVING IT REENTERED AGAIN FOR ANY NEW RECORD OF THE SAME KIND

The problem is that Dynamic Data resets every dropdownlist back to [Not Set] so all previous entries are lost and if you choose to keep (carry on) all previous entries then you will have a new screen but with ALL previous data not just the dropdownlist (which is the only thing valuable to be carrying on)

Any idea?

Carlos Porras (El Salvador)

Author: Asha.MP             
Posted Date: October 17, 2010     Points: 5   

Hi CarlosPorras..

If you set those drop down list values in the pageload event. you can set the values of the drop down list by selected value property of the drop down list.then in the page load the values of the drop down list will be display.

Thanks and Regards,
Author: CarlosPorras.sv             
Posted Date: October 18, 2010     Points: 5   


I have tried and found many ways of doing this even tough I don't think they are exactly the best choice in any case. It is not a good idea to be customizing pages for every single table you have in your database schema or creating a lot of session variables and querystrings as to pass data in any case. That besides cumbersome and high overhead in your application which is just silly.

I was expecting to find a way of getting "the whole page with all its components and all of its data as it was just exactly in the precise moment you pressed the "Insert hyperlink".

I was supposing that Dynamic Data should have available (in any way) a matrix of values/fields/controls as to make proper insertion in the database.

What I found is that Dynamic Data uses 3 programs: Insert.aspx, Default_Insert.aspx and ForeignKey_Edit.ascx but the behavior is not linear and is a little clumsy and tricky when trying to find out what is going on behind the scenes.

In any case, Default_Insert.aspx and ForeignKey_Edit.ascx put all dropdownlist to a [No Set] value.

My reasoning is based on this axioma: if you add with e.KeepInInsertMode = true; to the DetailsView1_ItemInserted event you are alowed to carry on all previous selected and typed data from previous entry. So there must be a way of resetting all other but dropdownlists.

This piece of code is ficticious but ilustrates what I'd like to find in VS2010:

e.KeepInInsertMode.ForeignKeysOnly = true;


Carlos Porras (El Salvador)

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

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