I am trying hard to update a business object inside a List<>.
I am using a checkbox list
When a checkbox list item is clicked I check if it exists, if yes I mark it as Dirty (means the user unchecks an item)If not, I add a new item to the list (means the user clicks a new item)and store it in view state
How do I update the Generic List with the Dirty Object ?
On form update, do I foreach and make separate lists of dirty and new objects to send to DB layer or would you recommend any other way ?
Here is my code.
protected void cblExclusions_SelectedIndexChanged(object sender, EventArgs e)
{
if (cblExclusions.SelectedIndex != -1)
{
ftExclusions myExclusion=new ftExclusions(); // Business object
I have a class Trans, with properties siteID and TID. I have a generic list of this class, TransList = list(Of Trans).
Now I want to find the Trans in TransList where the siteID is 3 and the TID is T1. There will only be one record. I want to then update this Trans in the TransList (so I need a reference to the Trans). I am trying to do the following, but it doesnt like it.
i'm having a gridview with textboxes and i'm allowing user to enter all the textboxes and when submit button is clicked, I'm constructing the Object and adding all the rows to LIST class.,After that i'm putting that LIST elements in a session. Everything is fine, But when i try to cast the session object to LIST type and pass it to XML serialization, I cannot see the elements in the list and it is showing LIST as NULL. I can see the generated XML string with ROOT and my classname as attributes without no data.
I need to cache System.Collection.Generic.List object with expiration time
var Root = from feed in feedhotel.Descendants(ota + "HotelContent") where (feed.Attribute("HotelCode") != null) select new xmlhotel() { }; return Root.ToList();
Is it possible to cache Root.ToList() for some time....
I have a gridview that shows a list of questions. Only one field is editable and if the information has been edited an email is sent to a specific "destiny". All works fine but when I try to get the Question ID in my SendEmail function (using Findcontrol) I get "Object reference not set to an instance of an object." How Can I get the Question ID?
I have a list view control. Each row within it has a rowid and a textbox where a note(user enters relevant info to that particular record) is entered. On a paging event I store the rowID and the note text in a generic list for retrieval if the user pages back later on. Goal here is to keep the text the user has entered. (see the code below)This generic list does in fact get populated correctly when I go to the next page currently. I can see this in Visual Studio. So now, when the user goes back to the first page I want to run a test within my Listviews ItemDataBound event. I want to see if the row ID being tested is part of the generic list. If so, I then want to take the corresponding note that is also within the list and bind it to the text box. However, I don't know how to write the correct conditional for this and how to bind the textbox if the conditional evaluates to true.
I have a web page, contains dropdownlist loading it with customers table using SQL datasource.
In the same web page i am creating a new customer, on clicking customer add it is creating a new row in customer table but the Customer Dropdown list is not getting updated.
I have added dropdown.databound() in the CustomerAdd button click event after creating the customer in the table.
I am trying to write a web page where i have to select an item form a drop down list.
I am using linq to sql to get the data from the database.the strange thing is that i can register the data to the drop down list but when i select one of them the drop down list lets me to the first item. I set post back = true because i want to update the page every time an item get selected. I wrote a really simple code to check what was going wrong but still...no success. Below i am bringing the code i wrote.
.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication7.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I have two generic list with Hotel class object. Both List contains hotel ID. I want to retrieve common hotel id from both Hotel List and assign to new HotelList.I have done following code for that but any other sort way to implement this kind of functionality.
[Code]....
Note: I dont want to use Linq because I am working on framwork 2.0
I'm trying to render out some images on an aspx page. Error I'm getting in the code below is:
DataBinding: '_Default+ImageThing' does not contain a property with the name 'FileName'. public class ImageThing { public string FileName; } private void DisplayThumbnailImages() { ImageThing imageThing1 = new ImageThing(); ImageThing imageThing2 = new ImageThing(); imageThing1.FileName = "asdf.jpg"; imageThing2.FileName = "aaa.jpg"; List<ImageThing> imagesToRender = new List<ImageThing>(); imagesToRender.Add(imageThing1); imagesToRender.Add(imageThing2); Repeater1.DataSource = imagesToRender; Repeater1.DataBind(); }
public class InvoiceModel{ public int InvoiceID { get; set; } public int Date { get; set; }[code]...
for create view i can use Html.TextBoxFor(m => m.InvoiceID) and for Date.but how can i fill List?and how can i use global for this list as Shopping cart?
I have a long running asynchronous process which returns a total of around 10-100 results over a 5 minute period. I want to update the page with the progress of the job and also show each result on the page in a list that grows dynamically as results are returned, all without any postback or page refresh.
What is the easiest way to save form data and retrieve it when the user navigates back to the page?
We have an application process that consists of several web forms. If the user clicks to go back a step we would like to auto-populate the fields. I am assuming there is a common generic way to do this without having to mess with individual controls - what is it?
I have one Hotel class that contains many properties. When I retrieve all hotels data from database, I store them in Generic List object.Now what I want that I have two properties called LowestPrice and HiestPrice. I want to get Minimum(LowestPrice) and Maximum(HiestPrice) from generic list directly.
Something like HotelList.Min(); Right now I have following logic implemented in my project, but I dont want to use foreach loop.
I have a list of Categories which I need to bind to a TreeView control in WPF and I can't find a working tutorial or get it working.My Category class consist of (ID, Title, ParentID). If the Category is a top level category the parentID is null.Can anyone sow me how to bind this to a treeview?
I am using datalist to bind the generic list. On databind() command I am getting error "nable to evaluate expression because the code is optimized or a native frame is on top of the call stack.
I am working in asp.net 3.5 page, where I want to bind a textbox with generic list data. And I have Previous & next button. Which will show the record in textbox.