开发者

Adding an OpenID selector into an ASP.NET content page

开发者 https://www.devze.com 2023-02-17 13:06 出处:网络
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.

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?


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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号