为什么我不能在 ASP.NET 登录控件中使用 LinkButton 作为登录按钮?
我为此浪费了一周的时间。我想使用 LinkButton 而不是标准的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我们的
,您的 LinkButton 在填充文本时是否可以工作?
Login
控件中使用 LinkButton 对我有用。但是,我注意到您的 LinkButton 没有文本。当链接完全为空时,我经常遇到链接无法正常工作的问题。即使是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