Is it possible to get postback effect (like in ASP.NET Webform) with dropdownlist without javascript?
I'd like to know if it's possible to get postback effect like in ASP.NET webform without using JavaScript. I've a collection of object to displ开发者_Go百科ay on the view. I'd like to place a dropdownList element somewhere on that view, such as, if I select a different item, then the postback occures and a new filtered collection is sent to the view.
I know for sure that's not automatic. However, I wonder if, by means of form element or whatever other means, that can be done without using javascript (Unobtrusive pattern).
Thanks for helping
Nope, not entirely without javascript.
You need to bind to the change
event of the <SELECT>
, by javascript, or set the onchange
attribute to execute some javascript, to simply cause a this.form.submit();
.
Don't be too afraid of javascript, tho. This sounds like a great place where it'll act exactly the way you want if javascript is enabled, and if it isn't, the site will still work, only the user will have to manually submit the form.
精彩评论