I've some RegisterStartupScript in my C# code behind that assign some values to some fields to some controls of a panel when it is openend.
Controls in the panel show as if their values had been assigned properly but in reality they work as if the had never been assigned, I've checked this on the dinamic view of my aspx page.
For example: This is an instruction of one of the startup scripts: document.getElementById("MainContent_Textbox1215").value ='CALL CENTER';, and in fact when I see that textbox on the screen it displays call center.
But at the same time, this is what is really in code and what the application interprets for future operations, taken from the dinamic view of that particular page.
<input name="ctl00$MainContent$Textbox1215" type="text" id="MainContent_Textbox1215" class="listBox" style="width:50%;" />
Similar things happen with radiobuttons, so even if on screen one seems to be selected the one that's selected for real is the one defined as default, and likely with all types of controls.
It's like for real a value had never been assigned to the textBox or the radiobutton... This is the weirdest thing I've ever seen in programming, hope you can guide me about what to do.
Even i have faced such a problem once while working with javascript and dotnet.
What i can say is that you might not have specified the Value attribute of the textbox in you html that is the reason it is not showing it in your dynamic aspx page but the value has been assigned and you can use it anywhere you want. This you can verify even with ha plain html page there also i faced the same thing. But if you have specified some value for the Value attribute you will see old value in the html source but if you try to access it using javascript it will show you the new value. I cant figure out the reason behind this behaviour but this is what i have experienced.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With