Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7033115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:01:21+00:00 2026-05-28T01:01:21+00:00

This seems impossible but I will ask anyway. Here is the scenario I have

  • 0

This seems impossible but I will ask anyway.
Here is the scenario

I have a MVC 3 View that loads 3 partial views, one for login, one for registration, and one for OpenID logins.

The first 2 work great with Ajax, however; the third view uses ajax to post to my openid controller where I go do some DotNetOpenAuth magic

Example:

 var response = authenticationRequest.RedirectingResponse;
                if(response.Status == HttpStatusCode.Redirect)
                {
                    return Json(new {redirectUrl=response.Headers[HttpResponseHeader.Location] });    
                }

I am doing a redirect from the returned Json from the controller the OpenId Login form posts to, “remember this post is via ajax”. So after the redirect I would like to replace the contents of the div with the initial openid login partial view with a new view based on what happens after the redirect to the provider, the user signs in, and I get a response back in my actionMethod. For instance, I will check in my database to see if I already have an account for that open id. If I don’t I would like to present a partial view to the user with some basic questions etc.. and let them add the open id account.

So it seems that this is not possible since the redirect kills any chance of getting data back to the original page.

Any ideas?

Process bullets as requested:

  • Main View renders a partial view with a form
  • Form inside partial view does ajax post to an ActionMethod in a controller
  • ActionMethod in the controller returns Json with a redirectUrl
  • OnSuccess callback function reads json result and does a client side redirect to the redirectUrl
  • User logs in to openid provider at redirected location
  • OpenId provider sends results back to the same ActionMethod that generated the initial Json redirectUrl result
  • Perform DB lookup on open Id and return partial view if user not found or log user in if found.

I would like to have the view id the user is not found get loaded in the original div the login form was in. This doesn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:01:21+00:00Added an answer on May 28, 2026 at 1:01 am

    A full page redirect destroys the original page, so no, you can’t have a subsequent redirect bring the user back to the original page with only one <DIV> updated.

    You have at least two alternatives:

    1. Simply take the full page redirect, and when the authentication result comes back from the Provider your MVC controller re-renders the entire original page. Downside: the controller can’t restore any user-specific state from the other views that were previously there.

    2. Use a popup window to log the user in, and when the login has completed the popup closes itself, passing back the authentication data to the parent page which can then re-render whatever portion it wants.

    DotNetOpenAuth supports both approaches, but of course there is plenty of code in the controller and view, external to the library, that you have to write. I do have a sample that demonstrates a relatively polished #2 implementation. It was at http://openidux.dotnetopenauth.net/ but the site appears to be down right now. But you can see a screenshot and download a project template for it here: http://visualstudiogallery.msdn.microsoft.com/81153747-70d7-477b-b85a-0374e7edabef

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems to be something that have been discussed by many. But unfortunately, I
This seems like an elementary issue but it has me stumped. I have a
This seems like it would have a really easy solution...but I've had a hard
Monitoring my global exception logs this error seems to be impossible to remove no
this seems to be a simple question, but i cannot get my head around
This seems like it should be simple. Here is my data store declaration: var
This seems a basic java question. I have one interface, Pipeline , which has
Seems like this should be super-simple but looking around for a simple (or half-way
This seems like a fairly straightforward question but I've been unable to find an
This seems true but I can't find anyone on the internet saying it is,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.