Re:Creating dyanmic form tag i.e. at run time
Web Development
1
Posts
1
Posters
0
Views
1
Watching
-
Hi to all, I have one class. That i have to convert to Custom control. Just I took one webcontrol library .For that i have to create form tag at runtime.How to write javascript for that. The following is my class. Check the PayNow() and answer me.
public string PayNow() { //construct script for paypal submission //construct a form with all hidden variables and say form.submit() string modify = string.Empty; if (CanUserModifySubscription) modify = "1"; else modify = "0"; StringBuilder paypalJavascript = new StringBuilder(); if (SubmitPaypal) { paypalJavascript.Append(" if (EnableSandboxMode) paypalJavascript.Append(SandboxUrl); else paypalJavascript.Append(PaypalUrl); paypalJavascript.AppendLine(">"); paypalJavascript.AppendFormat("{2}", "cmd", Command, Environment.NewLine); if (EnableSandboxMode) paypalJavascript.AppendFormat("{2}", "business", SandboxBusinessEmail, Environment.NewLine); else paypalJavascript.AppendFormat("{2}", "business", BusinessEmail, Environment.NewLine); paypalJavascript.AppendFormat("{2}", "item\_name", SubscriptionItemName, Environment.NewLine); paypalJavascript.AppendFormat("{2}", "item\_number", SubscriptionItemNumber, Environment.NewLine); paypalJavascript.AppendFormat("{2}", "no\_shipping", "1", Environment.NewLine); paypalJavascript.AppendFormat("{2}", "return", SuccessUrl, Environment.NewLine); paypalJavascript.AppendFormat("{2}", "cancel\_return", CancelUrl, Environment.NewLine); if (TrialSubscriptionPeriod != 0) { paypalJavascript.AppendFormat("{2}", "a1", TrialSubscriptionAmount.ToString("0.00"), Environment.