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 420183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:51:03+00:00 2026-05-12T18:51:03+00:00

I am wondering if this can be done easily. I am doing some paypal

  • 0

I am wondering if this can be done easily. I am doing some paypal stuff where when the user returns from the paypal site they go to a “success page” that you set before you send the user to paypal.

So now I give my customers 2 choices. They can do a one time payment or they can do a recurring payment.

Now with paypal express you have to do a call after they come back to you success page to finish the payment.

The thing though is a one time payment requires different fields then a recurring payment and paypal does not make it that easy to tell what kind of payment was chosen. You either have to pass your own custom field in and then do a if statement checks later or try to do what I am doing.

So a sample of what is happening is this.

Customer: chooses recurring or one time payment
MyCode: sets up all needed variables for each one
            - If one time payment is selected then success url would be Http://www.mysite.com/Success1
            - If recurring is select then success url would be Http://www.mysite.com/Success2

Customer: Logs into paypal account and pays
PayPal: sends them to my success url either Success1 or Sucess2 method in my controller.

So this is how my success1 view would look like

public actionresult Success1()
{
    // some paypal stuff

    ViewData["NameOfPartialView"] = "Success1";
    return View("Success");
}

So basically what I did was I made a view called “Success” and stuck a partial view that looks like this in it

 <% Html.RenderPartial(ViewData["NameOfPartialView"].ToString()); %>

So my thinking was this if I have a view called “Success” and I tell the 2 other views methods to load that view up then I will get what I want.

this would split my code apart into 2 views but to the customer they will always just see one url http://www.mysite.com/Success instead of http://www.mysite.com/Success1 or http://www.mysite.com/Success2

But this does not work 100% yet. It loads up the right partial view and stuff but the url does not change. I would have thought that since I am calling a different view it would change the url to that view.

It does not seem to work that way.

  • 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-12T18:51:04+00:00Added an answer on May 12, 2026 at 6:51 pm

    It is not the View you are choosing that determines the url but the controller action that has been executed. So for example if the Succcess1 action has been executed, no matter what view you rendered inside, the user will see http://www.mysite.com/controller/Success1 in her browser.

    I would suggest you the following urls:

    • If one time payment is selected success url would be http://www.mysite.com/SomeController/success/1
    • If recurring payment is selected success url would be http://www.mysite.com/SomeController/success/2

    And your controller action might look like this:

    public ActionResult Success(string id) 
    {
        // Maybe perform some logic based on the id parameter
        TempData["paymentType"] = id;
        return RedirectToAction("Index");
    }
    
    public ActionResult Index()
    {
        ViewData["paymentType"] = TempData["paymentType"];
        return View();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simple question. Just wondering if this can be done without me having to enforce
I know this can easily be done by writing a function, however, I was
I'm new to PHP but was wondering how this can be done. I want
I'm wondering if this can be done: I'm using a library for Panorama that
I was wondering if this can be done without using coroutines: private void GetAll()
I know this is possible in Perl, but I was wondering if this can
I have the following code which is working, I was wondering if this can
I can't find any information on this and I was wondering if this was
I have come across Evernote's bookmarklet and was wondering how this worked. You can
Just wondering if anyone can optimize this usortMonths() function to be better? Basically I

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.