将 OpenID 选择器添加到 ASP.NET 内容页中
我想使用 此处 找到的 OpenID 选择器 问题是我想在以下位置使用它内容页,它是母版页的子页。
那么我应该做哪些修改呢?
我的意思是我的母版页已经包含表单
<form id="form1" runat="server">
...
</form>
,但是 OpenID 选择器页面
<form class="openid" method="post" action="/Login.xhtml?ReturnUrl=">
</form>
以及 post 和 ReturnUrl 也包含了...这是我只需要在登录页面中...对吧?
那么我应该进行哪些修改并将可爱的 ID 选择器作为母版页中的内容呢?
I would like to use the OpenID selector found here The problem is that i would like to use it in a content page, which is child of a master page.
So what modifications should i make?
I mean my master page contains the form already
<form id="form1" runat="server">
...
</form>
but so does the OpenID selector page
<form class="openid" method="post" action="/Login.xhtml?ReturnUrl=">
</form>
together with post and ReturnUrl... which is something that i need only in the login page... Right?
So what modifications should i make and have that lovely ID selector as content in a master page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Asp.Net 只允许您的页面上有一个 runat=server 表单。您可以添加其他表单,但不能将其嵌套在主 Asp.Net 表单内。如果有一种方法可以构建您的登录页面,以便 OpenID 表单不在您的 asp.net 表单内,那么一切都应该正常工作。如果不能,您可以使用 iframe 来欺骗它,但这可能会使您需要执行的其他处理变得困难。例如,回发 OpenID 表单将影响 iframe,而不是默认影响整个窗口的内容,您需要将框架表单的目标设置为 _parent。
Asp.Net only allows you to have a single runat=server form on your page. You can add additional forms, but it can't be nested inside the main Asp.Net form. If there is a way to structure your login page so that the OpenID form is not inside your asp.net form, then everything should work fine. If you can't, you can trick it by using an iframe, but this might make other processing that you need to do difficult. For example, posting back the OpenID form is going to affect the iframe, and not the content of the whole window by default, you will need to set the target of the frame form to _parent.
@NerdFury 在 webforms 如何利用表单上的 runat=server 属性方面是正确的。
您可能需要查看 http://www.dotnetopenauth.net/ 以获得与 .网。
@NerdFury is correct in how webforms utilizes the runat=server attribute on forms.
You might want to check out http://www.dotnetopenauth.net/ for a selector that works well with .net.