Nicholas Paldino said:
Bruce,
The best I could think of is that the designer is modifying the code
somehow (meaning, not the code designer, but the visual one for your page).
Is there anything that you are doing in the HTML or are you modifying the
machine generated code somehow?
Nicholas,
I'm begining to see my problem. On the page I have a dropdownlistbox. I
created a function for when a user makes a selection change. What I did was
set the action to the new function I wrote...and VS puts some code in the
initializecomponent()...see below:
this.cbxAccountList.SelectedIndexChanged += new
System.EventHandler(this.cbxAccountList_SelectedIndexChanged);
Well...sometimes this codes "goes away". Maybe that's why it's always
needing to be saved? Anyhow, the main problem here is that the code goes
away. As I read through old Google findings...I find that I shouldn't put
any code in the InitializeComponent()...because it may "go away"....but I
didn't put that code there to begin with...the form designer did....and i
didn't modify it!
So, I guess my problem is now...how do I make the assignment for the
"selectedindexchanged" action of my dropdownlistbox? I tried putting the
code in the pageload...but that didn't seem to work. Any thoughts on where
I can make this assignment? Oh, and I see that it's also not keeping my
line for the load event either...damn... I read somewhere about puting code
after the InitializeComponent() but I don't understand where I can do that?
Don't I have to call it from the pageload or pageinit??
Any ideas?
-bruce