Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Order of client and server script execution

Status
Not open for further replies.

netangel

Programmer
Feb 7, 2002
124
PT
I need to run two scripts from a single click in a button. One is a client script, and the other is a server one.

I've managed to run both. The server with a normal event handler, and the client with the attributes collection:
btnTest.Attributes.Add("onClick", javascript:eek:pen('test.aspx');)

My problem is that I need the server script to ALWAYS run before the client one, as the server script puts a value on to a session varaiabl, and the client script opens a new aspx page that uses that variable on the Load event.

The order is not always the same. Sometimes the server script runs first, and everything works fine, but most of the times the client script opens the new page without having the variable with the rigth value.

Can anyone help me?

NetAngel
 
Why don't you send the user to the next page from your server-side function after you set your variable?

[c#] in the code behind

private void myFunction()
{
Session["myVariable"] = "Something";
Response.Redirect("text.aspx");
}

hth Daren J. Lahey
Just another computer guy...
 
I can't use neither the redirect nor the transfer method, because I need to open a new and always on top window. It's a sort of tool box, to use with the original window, and to be closed when it's not needed anymore.

If anyone knows how to open a new popup/dialog window using server script, please feel free to help me!!! It would save me a hole lot of trouble.


NetAngel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top