aspx refresh page problem

Soldato
Joined
18 Oct 2002
Posts
15,861
Location
NW London
Hi,

I have created a simple page here:

http://aspspider.net/sunama/

Now, when I press a button, the entire page automatically refreshes.

Question:
Is there any way I can prevent the page from refreshing?

Eventually what will happen is that a user will type in some information in the lower text box, press the "send message" button. At this point the text input, will appear in the top text box, and disappear from the bottom text box.

I would like all of the above to happen without the page refreshing.

Is there any way I can achieve this?


Thanks
 
You will want ajax for this kind of interaction, or you could possibly use frames or iframes to refresh the content.

If I use frames, would this mean that I place the entire application window (ie. grey area only), into a single frame. Would this do it?
 
Right gents. Thanks for the suggestions so far.

I have managed to prevent the auto reloading when pressing buttons.

However, also have a timer which much run in the back ground and tick every x MS. Everytime this timer ticks, this also has the effect of reloading the page. When this happens, the page Page_Load sub is activated and all manner of "stuff" happens.

What I want to do is prevent the page itself from reloading (just like a system app). The web app which I am creating is actually a system application and I am basically porting it over.

So, is there anyway that I can prevent the timer from reloading the page?
 
I'm using Ajax updatepanel.

I actually don't want the timer to reload the page at all, but it is doing it anyway. Is there a way to stop it from reloading the full page or any part of it?
 
Actually the timer is doing other stuff.

In particular it is checking an arrayList and if the arrayList has any strings in it, it is responsible for loading these into the top textBox (on the form).

The only way around this would be to use a thread, but to use a thread to update controls seems difficult. I've tried using a delegate (which is what I use for updating controls with threads, in system apps), but this technique is not working in the web app.
 
There doesnt appear to be a way to bind or limit the extent of the timer's scope.

Whenever it fires, it automatically reloads the entire page. The effect of this is that all the App Code is re-initialised, everytime the page is reloaded. This effectively resets all the variables in the all the classes contained within the App Code.

Its the equivalent of creating a system app, which closes and then re-starts the application, every time a timer ticks.
 
I am having a read through the life-cycle of the page and shall be spending time to reading up on ASP (I hate web programming with a passion).

My problem is that I am not an asp programmer and don't wish to be. I merely wish to port the vb.net system application (which is working beautifully), to the web, for testing purposes. That's all. If I have to McGuyver a dirty method to do this, then so be it. I don't want to spend weeks/months learning ASP when I really need to be spending my time developing my AICore server.

The web application is important though, which is why I am putting the time into getting it (almost) working correctly.

Anyway, I've spend the last 24 hours attempting to sort the problem with the timer.

I've posted my efforts up here:
http://aspspider.net/sunama/webchat.aspx

Bear in mind this is very much a test page and I am changing/updating/experimenting with this as I am going along.

I have left the AICore server running in the background, so you should be able to connect/disconnect (using the 2 buttons).

The problem is that due to the timer updating every 1s, it is impossible to type anything into the text box, because every time the timer updates the page, any text you may have typed out, is gone.

The IsPostBack method is doing absolutely nothing, so I have used a "dirty" method inorder to prevent all the variables being re-initialised.

The main problem here is that the timer is updating all the controls of the page on every tick. The variables are all behaving correctly, but the controls are not.

Is there a way for me to select the controls which are excluded from the timer tick update?

Thanks.
 
Back
Top Bottom