.net 下拉菜单 - 打开新窗口
我们的网站上有一个搜索表格,可以帮助您找到特定的健康提供商。这是一个 .net 应用程序,不是我的专长...
<select name="ctl00$middleContent$ddlProviderType"
onchange="javascript:setTimeout('__doPostBack(\'ctl00$middleContent$ddlProviderType\',\'\')', 0)"
id="ctl00_middleContent_ddlProviderType">
<option selected="selected" value="Please Select One">Please Select One</option>
<option value="Behavioral Health">Behavioral Health</option>
<option value="Dental">Dental</option>
<option value="Hospital in Idaho">Hospital in Idaho</option>
<option value="Medical in Idaho">Medical in Idaho</option>
<option value="Hospital/Medical outside of Idaho">Hospital/Medical outside of Idaho</option>
<option value="Hospital/Medical outside the U.S.">Hospital/Medical outside the U.S.</option>
<option value="Medicare Advantage Behavioral Health">Medicare Advantage Behavioral Health</option>
<option value="Medicare Advantage Medical">Medicare Advantage Medical</option>
<option value="Pharmacy">Pharmacy</option>
<option value="Urgent Care Centers">Urgent Care Centers</option>
<option value="Vision">Vision</option>
</select>
这些选择选项之一 [爱达荷州以外的医院/医疗] 使用以下功能打开一个新窗口:
ResponseHelper.Redirect("http://site.example.com", "_blank", "")
因此,在完美的世界中,用户将被发送到我们的姊妹站点,并在那里继续搜索。
这似乎是一个问题,因为它会启动当今浏览器中的大多数弹出窗口阻止程序。
因此,当发生这种情况时,用户似乎仍然认为他们是我的网站,并尝试继续使用我们的搜索表单,但该表单不起作用,因为它们应该在其他网站上。
我应该使用什么类型的功能来打开这个新标签或新窗口没有标记弹出窗口拦截器?
或者我不应该打开一个新窗口并将其保留在父窗口中?
We have a search form on our website, that helps you find specific health proviers. It is a .net application which is not my specialty...
<select name="ctl00$middleContent$ddlProviderType"
onchange="javascript:setTimeout('__doPostBack(\'ctl00$middleContent$ddlProviderType\',\'\')', 0)"
id="ctl00_middleContent_ddlProviderType">
<option selected="selected" value="Please Select One">Please Select One</option>
<option value="Behavioral Health">Behavioral Health</option>
<option value="Dental">Dental</option>
<option value="Hospital in Idaho">Hospital in Idaho</option>
<option value="Medical in Idaho">Medical in Idaho</option>
<option value="Hospital/Medical outside of Idaho">Hospital/Medical outside of Idaho</option>
<option value="Hospital/Medical outside the U.S.">Hospital/Medical outside the U.S.</option>
<option value="Medicare Advantage Behavioral Health">Medicare Advantage Behavioral Health</option>
<option value="Medicare Advantage Medical">Medicare Advantage Medical</option>
<option value="Pharmacy">Pharmacy</option>
<option value="Urgent Care Centers">Urgent Care Centers</option>
<option value="Vision">Vision</option>
</select>
One of these select options [Hospital / Medical outside of Idaho] opens a new window using the function:
ResponseHelper.Redirect("http://site.example.com", "_blank", "")
So in a perfect world, the user would be sent to our sister site, and continue their search there.
This seems to be an issue because it initiates most pop up blockers in browsers today.
So, when this happens, it seems that the users still think they are MY site, and tries to continue utilizing our search form, which does not function because they should on the other site..
What type of function should I be using to open this new tab or new window without flagging a pop up blocker?
OR should I just not open a new window and keep it in the parent window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短的回答是,您确实无法控制用户使用浏览器执行的操作。这意味着您需要提供一些用户允许弹出窗口所需的反馈,或者找出更好的方法来实现您的目标。例如,您可以使用一些 JavaScript 来隐藏选择并显示一个带有一些说明的单击链接。
HTH。
Short answer is that you really have no control over what a user does with their browser. That means you need to provide some feedback that the user needs to allow a popup, or figure out a better way to accomplish your goal. For instance, you could use some JavaScript to maybe hide the select and present a link to click with some instructions.
HTH.