Detailsview itemupdating e newvalues
I hate the idea with beign stuck with an ODS as its less efficient now I have to make 2 calls to my active directory to accomplish the same thing I was able to do with a single call and some rather complex logic (like adding and subtracting email address aliases to exchange). Schilbach" Hi Everyone, I am having a massive issue trying to get custom data into my DV. I created a Item Updating mode to handle the item update.
While an ODS may be nice for those afraid of code, I prefer to do my complex operations the old school way in the code behind page.
All I want to do is intercept the New Values and put them in my custom data solution.
This is driving me batty as I cannotdo anything with my data.
New Values("Some Field") with a value of null, it simply does not exist. "Flinky Wisty Pomm" wrote: If you just want to avoid duplicated code, why not move it into another method?
You get a "Object reference not set to an instance of an object" if you try to do something such as e. public string get Field(IOrdered Dictionary values, string key) then it's a simple case of string str Message Body = get Field("field1") get Field("field2")...
This can be beneficial to other community members reading the thread. Find Control("address"); FYI, something similar works in my case and I did another test last night after I saw your thread to confirm before I replied.
When all you've got is a Hammer, Every Problem looks like a Nail. Details View (and Grid View) don't work properly when not used with a proper datasource. New Values is used it is returning null and dv User. also, this is what superguppie is suggesting too (out of two options for you) Looking up the Controls should work. Page protected void Page_Load(object sender, Event Args e) protected void Radio Button List1_Selected Index Changed(object sender, Event Args e) protected void Details View1_Item Updating(object sender, Details View Update Event Args e) protected void Edit Button_Click(object sender, Event Args e) protected void Update Button_Click(object sender, Event Args e) protected void Cancel Button_Click(object sender, Event Args e) The Item class is as before.
Find Control("address"); whereas, and I think, your detailsview is named dv Record. When all you've got is a Hammer, Every Problem looks like a Nail. //ASPX //code behind c# using System; using System. I have a Details View control and when it get's updated i send an email containing the new details. To String(); This works fine apart from when one of the fields i am refering to is blank. It's not so much code duplication i am tring to avoid as having to do a load of comparisons to see if a particular value is set or not. New Values("Some Field") to a function/method is that if Some Field is set to null in the Details Views control then rather than there being e.