IE 不提供保存 ASP.NET 表单的密码 [英] IE not offering to save password of ASP.NET form

查看:26
本文介绍了IE 不提供保存 ASP.NET 表单的密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时微软会做一些非常愚蠢的事情,让我头疼.请帮我找出事实并非如此......拜托!

我正在开发的 ASP.NET (3.5) 站点的登录页面出现问题,IE(7 或 8 ... 无法忍受打开 6)不提供保存用户登录时的密码.我检查过其他浏览器和 Firefox、Chrome 和 Safari 都提供保存密码就好了.我还确认我的测试盒上保存的 IE 密码在其他站点上运行正常,例如谷歌等它工作正常.

我所做的搜索几乎没有出现,但它确实出现的很少似乎表明如果页面上的表单包含两个以上的文本控件,IE 将不会提供保存密码的功能.我的表单就是这种情况,它也有允许用户注册的控件.当我删除这些附加控件时,IE 神奇地提示保存密码,所以这似乎是真的.

现在...如果 ASP.NET 允许我有多个表单,一切都会好起来的,我将能够将这两个函数分离成独立的表单,IE 会提示保存密码.但是,ASP.NET 不允许我这样做,因为它只允许一个表单.我可以在那里捏造一个非 runat=server 表单并尝试这样做,但你猜怎么着?因为我的页面使用 MasterPage,所以我添加的任何表单标签都会自动删除,即使它是非 runat=server 表单.

所以,如果不从根本上改变我试图实现的目标,我看不出有任何解决办法.看起来我必须向我的用户解释,如果他们使用 IE(Microsoft 产品),则不会提示他们保存密码,因为我使用 ASP.NET(错误...Microsoft 产品)开发了我的网站.

如果是这样,我就是无法理解这是多么可笑.如果有人可以提供有关如何解决它的任何想法,可以告诉我我完全错了并且我自己就是一个大而愚蠢的白痴,或者只是想确认不仅仅是我认为这是非常愚蠢的,然后请,请这样做.

只是为了记录,我真的不想(也不明白我为什么必须)妥协我的设计并将我的页面分成两部分(这会给用户带来更糟糕的体验).

解决方案

@Chris 这就是我最终想要的.

因此,为了其他人的利益,我仍然在 runat=server 表单中使用我的激活控件,并在该页面的代码中处理这些控件.然后我有第二个标准 HTML 表单,其中包含发布到不同 .NET 页面的 HTML 输入文本字段.这涉及用户登录.我通过 Request.Form 获取此页面中的值并从此处处理登录.

优点:

一切正常,用户会像预期的那样记住他们的登录信息.

缺点:

我失去了使用 MasterPage 的能力(因为我需要页面中的两个表单)所以我不得不复制模板 - 我不太喜欢这个.

如果用户登录无效或导致某种错误,我必须重定向到初始页面并向其传递一个标志以使其显示相关的错误消息 - 我也不喜欢这样.

不过,就像我说的,它确实有效,在这种情况下,这才是最重要的.感谢您的投入.

Sometimes Microsoft does something so stunningly dumb that it makes my head hurt. Help me find out it's really not the case ... please!

I've got an issue with the login page of an ASP.NET (3.5) site I'm developing whereby IE (7 or 8 ... can't bear to open 6) doesn't offer to save the password when a user logs in. I've checked other browsers and Firefox, Chrome and Safari all offer to save the password just fine. I've also confirmed that IE password saving on my test boxes is is working OK on other sites and for e.g. Google etc it works fine.

The searching I've done has turned up very little, but what little it did turn up seems to suggest that IE won't offer to save a password if the form on the page contains more than two text controls. That's the case with my form which also has controls to allow a user to register. And when I remove these additional controls, IE magically prompts to save password, so this does seem to be true.

Now ... if ASP.NET would allow me to have multiple forms, all would be well and I would be able to separate out the two functions into standalone forms and IE would prompt to save passwords. But, ASP.NET doesn't allow me to do this as it only allows a single form. I could fudge a non runat=server form in there and try to do this, but guess what? Because my page uses a MasterPage, any form tag I add is automatically stripped out, even if it's a non runat=server form.

So, I don't see any way around this without fundamentally changing what I was trying to achieve. It looks like I have to explain to my users that they won't be prompted to have their passwords saved if they use IE (a Microsoft product) because I developed my site with ASP.NET (err ... a Microsoft product).

If this is so, I just can't get over how head-smackingly ridiculous this is. If anyone can offer any ideas on how to get around it, can tell me I've got it all wrong and am a big, stupid idiot myself, or just wants to confirm that it's not just me that thinks this is monumentously dumb, then please, please do so.

Just for the record, I really don't want to (and don't see why I should have to) compromise my design and split my pages in two (which will result in a worse experience for the user).

解决方案

@Chris That's what I went for in the end.

So for the benefit of anyone else, I still have my activation controls in a runat=server form and process these in the code for that page. Then I have a second, standard HTML form with HTML input textfields that posts to a different .NET page. This deals with the users login. I pick up the values in this page via Request.Form and deal with the login from here.

Upsides:

It all works and users get their logins remembered as they would expect to.

Downsides:

I lost the ability to use a MasterPage (as I need two forms in the page) so I effectively have had to duplicate the template - I don't like this much.

If the users login is invalid or causes some kind of error, I have to redirect to the initial page and pass it a flag to get it to show a relevant error message - I don't like this much either.

Like I say, though, it just works and in this case that's what was most important. Thanks for your input.

这篇关于IE 不提供保存 ASP.NET 表单的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆