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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:52:01+00:00 2026-06-06T16:52:01+00:00

I have 2 views, one called PostToPalPal as below and DomainConfirmationView. On the DomainConfirmationView

  • 0

I have 2 views, one called PostToPalPal as below and DomainConfirmationView. On the DomainConfirmationView i have a button that is linking to PostToPayPal which then redirects to paypal via a post event. The problem i have is when i click on this button it does not do anything. I have got this working on another page however i only had @model dynamic at the top of the page and the rest was HTML. Does anyone have idea’s where i am going wrong? Apologies if this is something really dumb, this is a my first go at MVC.

Thanks

@model application.Models.PayPal

@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <title>Index</title>
    <script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
</head>
<body>
    <form id="frm" action=@ViewBag.actionURL>
    @Html.HiddenFor(model => model.cmd)
    @Html.HiddenFor(model => model.business)
    @Html.HiddenFor(model => model.no_shipping)
    @Html.HiddenFor(model => model.@return)
    @Html.HiddenFor(model => model.cancel_return)
    @Html.HiddenFor(model => model.notify_url)
    @Html.HiddenFor(model => model.currency_code)
    @Html.HiddenFor(model => model.item_name)
    @Html.HiddenFor(model => model.amount)
    </form>
    <p style="text-align: center">
        <h4>
            <img src="../../Images/New-LogoPNG.png" />
            <br />
            You are now being redirected to Paypal...</h4>
    </p>
</body>
</html>
<script type="text/javascript" language="javascript">
    $(this.document).ready(function () {
        var frm = $("form");
        frm.submit();
    });   
</script>

DomainConfirmationView

@model Application.Models.DomainCustomerDetails
@using (Html.BeginForm("PostToPayPal", "Home"))
{
<input type ="hidden" name="item" value= ".com"/>
<input type = "hidden" name="amount" value="10" />

}
@{
    ViewBag.Title = "Domain order placed";
}

    @{
        String Input = "Hi" +".&lt;BR /&gt;&lt;BR /&gt;"
             + "You have a new domain order that has been placed."
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Domain Details"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Domain name:" + Model.DomainName
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Domain duration " + Model.DomainDuration
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Domain order type" + Model.OrderType
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + Model.FirstName
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + Model.LastName
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + Model.BusinessName
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + Model.Address
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + Model.Address2
             + "&lt;BR /&gt;&lt;BR /&gt;" 
             + Model.PostalCode
             + "&lt;BR /&gt;&lt;BR /&gt;" 
             + Model.EmailAddress
             + "&lt;BR /&gt;&lt;BR /&gt;" 
             + Model.ContactNumber
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Kind regards"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "xxx"
             + "&lt;BR /&gt;&lt;BR /&gt;" 
             + "Email: support@xxx.com"
             + "&lt;BR /&gt;&lt;BR /&gt;";

        String Output = Server.HtmlDecode(Input);

            WebMail.SmtpServer = "mail.xxx.com";
            WebMail.SmtpPort = 25;
            WebMail.EnableSsl = false;
            WebMail.UserName = "xxx@xxx.com";
            WebMail.Password = "xxxx";
            WebMail.From = "xx@xxx.com";
            WebMail.Send("xxx@xx.com", "You have a new domain order " + Model.DomainName,Output);



    }

     @{
         String Inputorder = "Hi " + Model.FirstName
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "We are pleased to say your domain name " + Model.DomainName + "has been ordered."
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Domain Details"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + Model.DomainName
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Domain duration" + Model.DomainDuration
             + "&lt;BR /&gt;&lt;BR /&gt;"     
             + "What to do next"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Server IP"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             +"Name Server 1:"
             + "&lt;BR /&gt;&lt;BR /&gt;" 
             +"Name Server 2:"
             + "&lt;BR /&gt;&lt;BR /&gt;" 
             +"MX:"
             + "&lt;BR /&gt;&lt;BR /&gt;" 
             +"A:"
             + "&lt;BR /&gt;&lt;BR /&gt;" 
             +"CNAME:"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "PLEASE NOTE"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Please allow 24 hours for any DNS changes to take effect due to DNS caching by your ISP."
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Many thanks for your order"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Kind regards"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "xxx"
             + "&lt;BR /&gt;&lt;BR /&gt;"
             + "Email: support@xxx.com"
             + "&lt;BR /&gt;&lt;BR /&gt;";


        String Outputorder = Server.HtmlDecode(Inputorder);

            WebMail.SmtpServer = "mail.xxx.com";
            WebMail.SmtpPort = 25;
            WebMail.EnableSsl = false;
            WebMail.UserName = "xxx@xx.com";
            WebMail.Password = "xxx";
            WebMail.From = "sales@xx.com";

            WebMail.Send( Model.EmailAddress, "Your new domain order: " + Model.DomainName,Outputorder);



    }



<p>Thank you, almost done</p>

<p>Please click the purchase button to continue</p>
<input type ="submit" name="btsubmit" value= "Purchase"/>

I also have a controller called DomainsController



      [HttpPost]
            public ActionResult PostToPayPal(string item, string amount)
            {
                YippeeYay.Models.PayPal paypal = new Models.PayPal();
                paypal.cmd = "_xclick";
                paypal.business = ConfigurationManager.AppSettings["BusinessAccountKey"];

                bool useSandbox = Convert.ToBoolean(ConfigurationManager.AppSettings["UseSandbox"]);
                if (useSandbox)
                    ViewBag.actionURL = "https://www.sandbox.paypal.com/cgi-big/webscr";
                else
                    ViewBag.actionURL = "https://www.paypal.com/cgi-bin/webscr";

                paypal.cancel_return = System.Configuration.ConfigurationManager.AppSettings["CancelURL"];
                paypal.@return = ConfigurationManager.AppSettings["ReturnURL"];
                paypal.notify_url = ConfigurationManager.AppSettings["NotifyURL"];

                paypal.currency_code = ConfigurationManager.AppSettings["CurrencyCode"];

                paypal.item_name = item;
                paypal.amount = amount;
                return View(paypal);
            }
  • 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-06-06T16:52:02+00:00Added an answer on June 6, 2026 at 4:52 pm

    This section:

    @using(Html.BeginForm("PostToPayPal", "Home"))
    {
      // Form goes in here
    }
    

    … is what’s writing your tags, which need to contain your submit button. At the moment your submit button is outside this section, so the only things in your form are your two hidden fields. Move your submit button inside the form and it should work.

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

Sidebar

Related Questions

I have two views that I would like to combine into one. The first
I have an app that have several views. In one view I would like
In one of my iPhone projects, I have three views that you can move
I have two views (for simplicity sake), one called Events, one called Friends. Their
I have a link in one of my views that users can click that
So I have two views. One views loads when I start the app. Then
I have a simple Flask app that contains a few basic views. One of
I have two views within one .xib (one view for landscape, another for portrait).
I have 2 customer views one for create and one for edit. I am
I have two views in my ViewFlipper . One of views contains a ListView

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.