URGENT - ASP.NET, AJAX and server side events

M

Mike

Hi,



I'm wondering if I can do this with ASP.NET?





I have an ASP.NET application that runs a component that fires some
events.

When these events are fired, I will like to trap them at client level
(that is the web browser session where the user is running the actual
application).

Let's say this scenario will be like this:



Person clicks on ASPX page button.



(I'm using AJAX) so this triggers the CLICK event of the button on the
server side, and this executes come code .



This code will fire some events at the server level ...



I want the client (user in its web browser) to "see" this events as they
are fired and react properly, let's say update a LABEL control as this
events are triggered and catched.





Please help me out here, you savvy people, because I'm stuck!





Later and thanks,



Mike
 
?

=?windows-1252?Q?G=F6ran_Andersson?=

Mike said:
Hi,

I’m wondering if I can do this with ASP.NET?

I have an ASP.NET application that runs a component that fires some events.

When these events are fired, I will like to trap them at client level
(that is the web browser session where the user is running the actual
application).

Let’s say this scenario will be like this:

Person clicks on ASPX page button…

(I’m using AJAX) so this triggers the CLICK event of the button on the
server side, and this executes come code …

This code will fire some events at the server level …..

I want the client (user in its web browser) to “see” this events as they
are fired and react properly, let’s say update a LABEL control as this
events are triggered and catched.

Please help me out here, you savvy people, because I’m stuck!

Later and thanks,

Mike

I already replied to this question in the m.p.d.languages.vb group:



If you want to update something on the page, just put it in an update panel.

If you want to do something more complicated that needs client script to
run, you can send data to the client and register an event handler for
the EndRequest event to recieve it:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);

function EndRequest(sender, args) {
// handle the data here
}

The args argument is an object that has a dataItems property that
contains data items that you send from the server. Use the
RegisterDataItem method of the ScriptManager class to send data items
from the server.
 
M

Mike

Can you please send me a more detailed example?
Do I have to use Javascript or can I do it with VB functions (manage
code)?

Thanks

-----Original Message-----
From: Göran Andersson [mailto:[email protected]]
Posted At: Sunday, September 09, 2007 3:56 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: URGENT - ASP.NET, AJAX and server side events
Subject: Re: URGENT - ASP.NET, AJAX and server side events
Hi,

I’m wondering if I can do this with ASP.NET?

I have an ASP.NET application that runs a component that fires some events.

When these events are fired, I will like to trap them at client level
(that is the web browser session where the user is running the actual
application).

Let’s say this scenario will be like this:

Person clicks on ASPX page button…

(I’m using AJAX) so this triggers the CLICK event of the button on the
server side, and this executes come code …

This code will fire some events at the server level …..

I want the client (user in its web browser) to “see” this events as they
are fired and react properly, let’s say update a LABEL control as this
events are triggered and catched.

Please help me out here, you savvy people, because I’m stuck!

Later and thanks,

Mike

I already replied to this question in the m.p.d.languages.vb group:



If you want to update something on the page, just put it in an update
panel.

If you want to do something more complicated that needs client script to

run, you can send data to the client and register an event handler for
the EndRequest event to recieve it:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest)
;

function EndRequest(sender, args) {
// handle the data here
}

The args argument is an object that has a dataItems property that
contains data items that you send from the server. Use the
RegisterDataItem method of the ScriptManager class to send data items
from the server.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Mike said:
Can you please send me a more detailed example?

A more detailed example of what? I don't know enough about what you are
trying to do to be more detailed.
Do I have to use Javascript or can I do it with VB functions (manage
code)?

That depends on what you are trying to do. If you want to run some code
in the client, that would be Javascript.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,516
Members
44,984
Latest member
PeakCBDGummiesReview

Latest Threads

Top