I wondered where my intellisense had gone for jQuery with MVC3 and Razor. Anyway there is a fix for it:
Add the following to your view (with the jQuery vsdoc version you have:
The if-statement prevents the script tag from being rendered into the html source code.
Grab jQuery 1.5.0 vsdoc from here -> http://damianedwards.com/files/jquery/jquery-1.5-vsdoc.js
I have bumped into this quite a few times. Every time I have it has turned out to be a path problem, always check this first.
If you can, stick a breakpoint on the save call and look at the path your are saving, follow the exact path and check it precisely using windows explorer.
Nasty problem. Lesson learnt.
I could not figure out why I was seeing this error, clearselection, setting index -1 etc, nothing worked when trying to set a dropdownlist selected value from code behind.
Turns out it was because I was adding a ListItem to multiple dropdownlists without instantiating a new one for each dropdownlist. This caused all the problems I was seeing.
For every Dropdownlist, create a new instance of the ListItem object before adding it – do not share it accross controls.
I had a bizzare problem. From a completely unrelated aspx page I was finding myself jumping into the page_load of my default.aspx page.
Turns out this was because I had an ‘<asp:image’ tag with the image url not set (rendered as src=””).
Tricky problem to identify.