Ask a Question related to ASP.NET General, Design and Development.
-
Roberto López #1
How to handle personalized events of a class in a web form?
Hello,
I´m trying to do a progress page that indicates some visual information to
the user in a long directory copy process. I have a Class that copys
directories from one location to other. The function "CopyDirectory" is
started in a new Thread. This class also contains one Event that is raised
every directory is copied.
On my page I have declared an instance of my class with the "WithEvents"
modifier and i have writed an event handler for the class event into the
page. Every time the event is raised I change the text property of a textbox
in the page but it not shows because the page not refresh the textbox value.
I don´t know if it is possible to do this in a Web page. (I think In windows
forms it may be run).
Any suggestions will be apreciated.
Thanks.
Roberto López
Roberto López Guest
-
Inherited Control Does Not Handle All Events
Hello everyone, I'm building a series of custom controls inherited from an ImageButton and certain events are never getting thrown, or at least... -
How to add multiple buttons to a datagrid row... and handle their events
I have a DataTable that I'm currently displaying in a DataGrid... but I have the case where I need to use multiple buttons/linkButtons in each row of... -
Can we handle events for user controls
Can we handle events for user controls? If so how? Suppose we r creating a user control using a label can we handle a event for the user control... -
How to handle Form Error Event in class module?
Hi, I use a class module for navigation buttons with all my forms. Some of the buttons are Save_Record and Close_Form. I sink all form events... -
Question: Handle Events From Web User Controls
I was reading an article that talked about using the OnBubbleEvent overrides function to handle events from a web user control... -
Steve C. Orr, MCSD #2
Re: How to handle personalized events of a class in a web form?
The problem is that only the page can request a refresh of itself. You
can't do it from the server side.
You can have the browser refresh the status by putting an HTML line like
this in your code:
<META HTTP-EQUIV="refresh" CONTENT="3">
That will cause the browser to refresh every 3 seconds (and you can check
the status of the operation each time and redirect to a "done" page when
appropriate.)
Here's more details:
[url]http://www.fawcette.com/vsm/2002_11/magazine/features/chester/[/url]
[url]http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=547[/url]
Another option is that you could call a web service from your client side
JScript. Use the web service behavior for this. (WebService.htc) This
technique works with IE only.
Here's more details:
[url]http://msdn.microsoft.com/library/default.asp?url=/workshop/author/behaviors/overview.asp[/url]
[url]http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=/downloads/samples/internet/behaviors/library/webservice/default.asp[/url]
--
I hope this helps,
Steve C. Orr, MCSD
[url]http://Steve.Orr.net[/url]
"Roberto López" <roblop@telecable.es> wrote in message
news:%23tfzJf7VDHA.2568@tk2msftngp13.phx.gbl...textbox> Hello,
> I´m trying to do a progress page that indicates some visual information to
> the user in a long directory copy process. I have a Class that copys
> directories from one location to other. The function "CopyDirectory" is
> started in a new Thread. This class also contains one Event that is raised
> every directory is copied.
> On my page I have declared an instance of my class with the "WithEvents"
> modifier and i have writed an event handler for the class event into the
> page. Every time the event is raised I change the text property of avalue.> in the page but it not shows because the page not refresh the textboxwindows> I don´t know if it is possible to do this in a Web page. (I think In> forms it may be run).
> Any suggestions will be apreciated.
>
> Thanks.
>
> Roberto López
>
>
Steve C. Orr, MCSD Guest
-
alien2_51 #3
Re: How to handle personalized events of a class in a web form?
Because of the disconnected stateless nature of a web application I don't
this approach will work.. Here's what I'm guesing is happening..
Your page is recieving the events as they are raised by your class declared
WithEvents but the page is only rendered once after the last event fired
(synchronous execution, meaning the page is not rendered until all the
processing is done) so your TextBox has the last directory that was copied
written to its text property...To verify this set a breakpoint in your event
handler and see if you are hitting that breakpoint...
"Roberto López" <roblop@telecable.es> wrote in message
news:#tfzJf7VDHA.2568@tk2msftngp13.phx.gbl...textbox> Hello,
> I´m trying to do a progress page that indicates some visual information to
> the user in a long directory copy process. I have a Class that copys
> directories from one location to other. The function "CopyDirectory" is
> started in a new Thread. This class also contains one Event that is raised
> every directory is copied.
> On my page I have declared an instance of my class with the "WithEvents"
> modifier and i have writed an event handler for the class event into the
> page. Every time the event is raised I change the text property of avalue.> in the page but it not shows because the page not refresh the textboxwindows> I don´t know if it is possible to do this in a Web page. (I think In> forms it may be run).
> Any suggestions will be apreciated.
>
> Thanks.
>
> Roberto López
>
>
alien2_51 Guest
-
Roberto López #4
Re: How to handle personalized events of a class in a web form?
Hi,
And it´s possible to implement something function like AutoPostBack. Eg. the
option button control like the dropdownlist control has a property
"AutoPostBack" that do a page postback when the control changed. How can I
implement something like this to post bak the page when the clas event is
raised.
"Roberto López" <roblop@telecable.es> escribió en el mensaje
news:#tfzJf7VDHA.2568@tk2msftngp13.phx.gbl...textbox> Hello,
> I´m trying to do a progress page that indicates some visual information to
> the user in a long directory copy process. I have a Class that copys
> directories from one location to other. The function "CopyDirectory" is
> started in a new Thread. This class also contains one Event that is raised
> every directory is copied.
> On my page I have declared an instance of my class with the "WithEvents"
> modifier and i have writed an event handler for the class event into the
> page. Every time the event is raised I change the text property of avalue.> in the page but it not shows because the page not refresh the textboxwindows> I don´t know if it is possible to do this in a Web page. (I think In> forms it may be run).
> Any suggestions will be apreciated.
>
> Thanks.
>
> Roberto López
>
>
Roberto López Guest
-
Roberto López #5
Re: How to handle personalized events of a class in a web form?
It´s really good explained,
Thanks a lot.
"alien2_51" <dan.billow@n.o.s.p.a.m.monacocoach.com> escribió en el mensaje
news:OXxUd6EWDHA.1488@TK2MSFTNGP09.phx.gbl...that> The client has to generate the postback, the client has no knowledge of
> anything your doing on the server... It has no knowledge of your classprocessed> is responding to events.. In fact, while your page class is biengthat> and is responding to events that are bieng raised the client hasn't even
> been issued a response yet.. So your still at the server you don't have a
> page or any controls to autopostback from... If you want to use a progress
> bar build a windows application... or embed a rich control on your pagefor> can run its process on the client.. The type of syncronization requiredI> a progress bar is not available in a traditional web application that uses
> ASP.NET controls...
>
> HTH
>
>
> "Roberto López" <rlopez@eurosistemas.net> wrote in message
> news:ucdO8ACWDHA.1580@tk2msftngp13.phx.gbl...> the> > Hi,
> > And it´s possible to implement something function like AutoPostBack. Eg.> > option button control like the dropdownlist control has a property
> > "AutoPostBack" that do a page postback when the control changed. How canis> > implement something like this to post bak the page when the clas eventinformation> > raised.
> >
> >
> >
> > "Roberto López" <roblop@telecable.es> escribió en el mensaje
> > news:#tfzJf7VDHA.2568@tk2msftngp13.phx.gbl...> > > Hello,
> > > I´m trying to do a progress page that indicates some visualis> to> > > the user in a long directory copy process. I have a Class that copys
> > > directories from one location to other. The function "CopyDirectory""WithEvents"> raised> > > started in a new Thread. This class also contains one Event that is> > > every directory is copied.
> > > On my page I have declared an instance of my class with thethe> > > modifier and i have writed an event handler for the class event into>> > textbox> > > page. Every time the event is raised I change the text property of a> > value.> > > in the page but it not shows because the page not refresh the textbox> > windows> > > I don´t know if it is possible to do this in a Web page. (I think In> >> > > forms it may be run).
> > > Any suggestions will be apreciated.
> > >
> > > Thanks.
> > >
> > > Roberto López
> > >
> > >
> >
>
Roberto López Guest



Reply With Quote

