Asp net dropdownlist selected value not updating
The data is inserted appropriately and then I have the mode changed to Read Only(Item Template). When I click Edit the formview sends me to the Edit Item Template with all of the correct data in the fields, including the Drop Down List.
Whether I make a different selection or leave the selection as is and select Update, an error is thrown because there is no value in the Selected Value property of the Drop Down List: What is happening is the dropdownlist is losing it's value's(Selected Value, Data Value, Text Value) when it changes to the Edit Item Template, however, it displays the Data Text Fields in the Drop Down List appropriately.
As always there are other ways of doing this, but I recommend at least giving the following a shot: dac IT: Enable View State = true on both the dropdownlist control and the formview. Can you see anything that can be wrong with this setup? What I am suggesting is happening is what we call a race-condition.
Because using windows Forms employs the use of threading so heavily, I'm guessing the values are being destroyed and/or changed unexpectedly by other threads. As far as I can see, there is nothing wrong with your ASP. It is not exactly the functionality that I need but it is at least working. I have a good feeling that there may be a problem with entity datasources.
I even traced this in the Item Updating event(Please See Attached Screen Shot). "The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years.
I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing.
For whatever reason, I have to manually pull the selected value out and force it through because the Bind() does not work.
Well if you have been hearing those words more too often from your colleagues but haven’t had the chance to explore j Query yet, then here’s this beginner guide for you to get started with j Query and ASP. j Query is a fast, lightweight Java Script library that is CSS3 compliant and supports many browsers.
You just need to keep both the runtime library and the documentation file next to each other.
Our first example was a simple ‘Hello World’ example to keep up with the tradition while introducing a new language.
The viewstate is where it normally gets the control's list of values, then it does binding or selecting just before rendering.
I did not exactly know that, however, I do understand it.With View State disabled it does not, but when loading the Edit Template the Drop Down List does not remember the selectedvalue because now I cannot use the Selected Value = ' I suspect that your data for the drop down list is being populated after the Init event which is why the selected value isn't working. I think that my best route will be to figure out a way to manipulate the values by storing the value I need in a session variable and passing it into the ddl control's Selected Value property in the prerender event.Check to see when it gets it's data, and if possible change that to the init event it should work for you. I will keep you posted as this moves forward and post a final solution. -Kyle First thing that you need to do is add a hidden Label field on your Item Template.Also, j Query intellisense annotation support will be available as a free web-download.