简体   繁体   English

导航到选择下拉菜单中的同一页面,而无需清除控件?

[英]navigate back to same page on select-dropdown selection without clearing down controls?

I have a text box and a drop-down selection on a page, plus a bunch of urls. 我在页面上有一个文本框和一个下拉选择,外加一堆网址。

Clicking on the urls navigate back to the page with an updated url (for asp.net MVC2 functionality). 单击URL导航到具有更新URL的页面(用于asp.net MVC2功能)。 This does not cause the texbox to clear down. 这不会导致texbox消失。

On my dropdown "onchanged" event I call window.location = url; 在下拉菜单“ onchanged”事件中,我调用window.location = url; (with url being the pages url with a sortOrder in the query string)... but this causes the pages text-box text to clear down. (其中url是查询字符串中带有sortOrder的页面url)...但这会导致页面文本框文本被清除。

Is there any way I can get the drop-down to postback to the page on selection changed and NOT clear down the text box? 有什么方法可以使下拉菜单更改后回发到页面,而不清除文本框?

Cheers, 干杯,

James. 詹姆士。

What do you mean with "clear down"? “清除”是什么意思? Does the dropdown lose it's selected item (eg gets reset to a default value)? 下拉菜单会丢失其所选项目吗(例如,重置为默认值)?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AngularJS:根据对第一个选择下拉列表的选择来填充第二个选择下拉列表 - AngularJS: Populate second select-dropdown based on choice of first select-dropdown 使用JQuery导航到下拉菜单上具有选择的页面 - Navigate to a page with selection on dropdown menu with JQuery 滚动浏览到不同的页面并返回相同的位置 - scrollspy navigate to different page and back at same position 如何将列表图表缩小为一个并使用选择下拉列表显示选择而不刷新页面? - how to reduce list chart to one and use select dropdown to show selection without refresh page? 刷新下拉列表选择而无需在jQuery中刷新页面 - Refresh dropdown selection without page refresh in jQuery 如何从下拉列表中选择默认值,然后在列表中选择其他任何元素后又返回到相同值? - How to select default value from dropdown list and then return back to same value after selection any other element in the list? 从选择下拉菜单中选择时无法重定向页面 - Not able to redirect page on selection from select drop down menu 如何导航回到搜索页面? - How navigate back to search page? Javascript:如何在同一页面(锚)上导航而不重新加载自身 - Javascript: How to navigate on the same page (anchor) without reloading itself 根据下拉选择隐藏/显示控件 - Hide/show controls based on dropdown selection
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM