html form submission at runtime  in c#

Posted on 2011-10-18
Last Modified: 2012-08-13
hi experts,

In my .net c# page button submit i m creating an html form object and using the following code to submit it and upon submission the user is taken to another website. After the button click post back when the javascript is still  submitting the form created at runtime, the user sees the same page like nothing has happened on form submission as javascript takes few extra seconds to redirect to that page. Some times the user presses the submit button again to make sure successfulll form submission. How can we possibly resolve this issue

private void PayPalPostScript(System.Web.UI.Page Page)
        //This registers Javascript to the page which is used to post the PayPal Form details
        StringBuilder strScript = new StringBuilder();
        strScript.Append("<script language='javascript'>");
        strScript.Append("var ctlForm = document.getElementById('frmPP');");
        Page.ClientScript.RegisterStartupScript(this.GetType(), "PPSubmit", strScript.ToString());
Question by:mmalik15
    1 Comment
    LVL 28

    Accepted Solution

    I would recommend disabling the submit button so they don't click it again.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now