I inserted the gif image in securetrans.aspx page and wrote the payment gateway request code in securetrans.aspx.cs page pageload, here the problem is the loading image is not at all showing up through out the request and the page is empty till the response comes. I cant get it through many searches, hope some one helps me out..
Thanks in advance...
my securetrans.aspx.cs code is
protected void Page_Load(object sender, EventArgs e)
{
string Url = "https://paymentpagetosendrequest";
string Method = "post";
string FormName = "form1";
NameValueCollection FormFields = new NameValueCollection();
FormFields.Add("account_id", "5880");
FormFields.Add("reference_no", Session["UserID"].ToString());
FormFields.Add("amount", Session["Amount"].ToString());
FormFields.Add("return_url", "http://responsepage");
for (int i = 0; i < FormFields.Keys.Count; i++)
{
Response.Write(string.Format("<input name=\"{0}\" type=\"hidden\" value=\"{1}\">", FormFields.Keys[i], FormFields[FormFields.Keys[i]]));
}
}
and secruretrans.aspx
Loading... Please Wait!!!
You will be Redirected to Secured Transaction Page....
(Please don't press back or refresh button.)
<asp:Image runat="server" ImageUrl="images/Loader.gif" ID="img" AlternateText="Loader" />
Unless you specifically code it to send response within you pageload before some other code (which will cause another problem that you can't add more things to the response for display) as while you code running the browser got nothing can show up, I think you are trying to do something like display a processing img, I'd say suggest you go with some jQuery plugin like blockUI: http://www.malsup.com/jquery/block/
EDIT:
OK I assume user come to your page via a redirect or something so you don't have any button, then I suggest you add the blockUI on that page before send redirect so user can see the loading message. Or you can build a third page, and user will be redirect to that page first, that page got nothing except the loading message and a html head meta http-equiv="REFRESH" that actually lead them to your page, so that they can see loading image. Check something here: http://www.instant-web-site-tools.com/html-redirect.html