I have a dropdown list boxes in the page.
When I Load the page. the dorpdown list boxes values not showing P开发者_C百科lease Select.. its allways showing the previously selcted value.
why its not defaulting it to Please select is that I am doing something wrong in this aspx page?
thanks
Most likely because it is finding existing values for those drop down lists in the ModelState and applying those.
Try adding this code to your Index method:
ModelState.Clear();
This is assuming you mean after you click the Save button?
That's a function in the browser. It remembers what you entered in the form previously, and fills the form automatically.
Press Ctrl
+F5
to reload the page without remembering form data.
That is the default behavior of most of the browser. You need to do Ctrl + F5 to reload it fresh.
Load the dropdown on
$(document).ready(function () {
});
精彩评论