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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re Design my Architecture 1

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
Ive been having an issue with an intermittent bug that only appears on a server, not local host.

After spending a lot of time on it, Ive nailed it down to the following.

When a particular page is submitted, it has to do 2 things.

It has to post back to the server, so that the data entered on the page can be processed, and added to the database.

At the same time, using client side javascript I am opening a new aspx page, that needs to pull some of that data back from the database, and render it in a form that is printed (more javascript).

Sometimes, when the printout form is created and displayed in the new browser, no data is present (Though it is in the database by the time I can check on it).

My initial thoughts are, on the second page, to have (Pseudocode)
Code:
while (dataset.rows = null) and (emtpyRowCounter < 4)
{
  emptyCount ++;
  thread.sleep(1000);
}

so if for any reason there is no data after say 4 seconds, then an error can be reported. However, it seems a really clumsy way of handling this, and could, if a few differnet customers hit the same point at the same time, lead to a lot of Web Server threads sat there sleeping.

Any other suggestions, comments or even ridicule on my investigations that the pages are getting ahead of each other?

K
 
Once you've finished running the relevant code in the function, register some javascript code to open the new page (via the ClientScript.RegisterStartUpScript method).


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
YOuve lost me there, you saying I should post back, run the database insert code, then add a javasript funciton on the Body.Onload event to response redirect to my new page?

If so, its a nice idea, but I missed out an additional complication that once the database code is run, the old page redirects to a menu (Sorry, I didnt think that the solution would be that far reaching)

(But I guess I could redirect to 2 pages via the javascript? - I'll give it a try, thanks)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top