html form submission at runtime  in c#

Posted on 2011-10-18
Medium Priority
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

strickdd earned 2000 total points
ID: 36986470
I would recommend disabling the submit button so they don't click it again.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 5 hours left to enroll

864 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