为什么我不能在 ASP.NET 登录控件中使用 LinkBut​​ton 作为登录按钮?

发布于 2024-08-20 16:23:48 字数 443 浏览 3 评论 0原文

我为此浪费了一周的时间。我想使用 LinkBut​​ton 而不是标准的 asp 按钮,这样我就可以将 SkinID 附加到它上面,用于链接按钮。使用链接按钮时:

匿名 cookie 永远不会被删除,并且 Profile_OnMigrateAnonymous 会被无休止地调用。由于 cookie 永远不会被删除,所以我的个人资料永远不会设置为正确的用户。

我将其改回常规的 asp 按钮,它的工作方式与应有的一样。有谁知道为什么我不能在登录控件上使用上述代码作为登录命令?我需要知道如何将我的皮肤应用到普通按钮上。

I lost a week of time on this. I wanted to use a LinkButton instead of the standard asp button so I could attached a SkinID to it that I use for link buttons. When using the linkbutton:

<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Login" SkinID="loginButton"
ValidationGroup="rgtLogin" />

the anonymous cookie is never deleted and the Profile_OnMigrateAnonymous is called endlessly. And since the cookie is never removed, my profile is never set to the correct user.

I changed this back to the regular asp button and it works like it should. Does anybody know why I can't use the above code for the Login command on the Login control? I need know to figure out how to apply my skin to a regular button.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

久隐师 2024-08-27 16:23:48

在我们的 Login 控件中使用 LinkBut​​ton 对我有用。但是,我注意到您的 LinkBut​​ton 没有文本。当链接完全为空时,我经常遇到链接无法正常工作的问题。即使是  ,您的 LinkBut​​ton 在填充文本时是否可以工作?

Using a LinkButton works for me in our Login control. However, I noticed that your LinkButton has no text. I've often-times had problems with links working properly when they're completely empty. Does your LinkButton work when filled with text, even if it's an  ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文