I am having trouble calling a javscript routine from inside the ajax panel server event.
i have an ajax panel which wraps severel controls on the page so that when the server events fire, they all fire through ajax and not postback.
One button in particular needs to do some database processing and then call a javsacript routine that will open a new window.
I have tried the following methods inside the button click routine.
string strBuildUp = "<script type=\"text/javascript\">";
strBuildUp += " PaymentGateway('" + OrderId.ToString() +"')</script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), "paymentgateway", strBuildup);
I also tried
Page.Response.Write(strBuildUp);
and
Page.ClientScript.RegisterStartupScript(this.GetType(), "paymentgateway", " PaymentGateway('" + OrderId.ToString() + "')");
Then I tried to simplify the call with
Page.ClientScript.RegisterStartupScript(this.GetType(), "paymentgateway", "alert('hello'");
and
Page.Response.Write("alert('hello')");
if I remove the ajax panel then these will work fine!! (I like ajax I dont want to remove it)
None of the above worked for me I even replace registerstartupscript with register clientscriptblock (just in case).
I know that I can resolve this by creating an edit box on the page with no value, then creating a timer function that waits for a value to be added to the text box and then fires the javascript event from the javascript timer event.
On the server OnAjaxRequest event i simply put a value in the box and it all will happen.
But i was hoping for something a bit more tidier than that.
Does anyone know how i can achieve this without doing my suggested fudge?