checking data before allowing user to move on

D

D James

Scott Mitchell published an article (on the 4GuysFromRolla site) on
checking whether data has changed on a page before allowing a user to
leave the page.
I have used his solution and created a class, ClientSidePage, which
inherits system.web.ui.page.
In my main page (with the fields to be checked) I have used inherits
ClientSidePage. When I try to run the main page none of the normal
events (like page_load) can be found as if it isn't seeing the
system.web.ui.page code.
Can anyone help.
 
S

Scott Mitchell [MVP]

D said:
Scott Mitchell published an article (on the 4GuysFromRolla site) on
checking whether data has changed on a page before allowing a user to
leave the page.
I have used his solution and created a class, ClientSidePage, which
inherits system.web.ui.page.
In my main page (with the fields to be checked) I have used inherits
ClientSidePage. When I try to run the main page none of the normal
events (like page_load) can be found as if it isn't seeing the
system.web.ui.page code.

Are you using VS.NET? What does your main page class look like? Could
you describe in further detail what you mean by "When I try to run the
main page none of the normal events (like page_load) can be found..."
Do you mean that they are not firing when you visit the page through a
browser, or they are not shown in VS.NET or what, exactly?

Thanks.
 
M

masoud bayan

Could you please send article link.

Thanks
Masoud


Scott Mitchell said:
D said:
Scott Mitchell published an article (on the 4GuysFromRolla site) on
checking whether data has changed on a page before allowing a user to
leave the page.
I have used his solution and created a class, ClientSidePage, which
inherits system.web.ui.page.
In my main page (with the fields to be checked) I have used inherits
ClientSidePage. When I try to run the main page none of the normal
events (like page_load) can be found as if it isn't seeing the
system.web.ui.page code.

Are you using VS.NET? What does your main page class look like? Could
you describe in further detail what you mean by "When I try to run the
main page none of the normal events (like page_load) can be found..."
Do you mean that they are not firing when you visit the page through a
browser, or they are not shown in VS.NET or what, exactly?

Thanks.

--

Scott Mitchell [ASP.NET MVP]
(e-mail address removed)
http://www.4GuysFromRolla.com/ScottMitchell
 
D

D James

Scott,
Thanks for looking at this. I am using VS.NET. When I change the
inherits declaration at the top of the main page class to inherit the
ClientSidePage all the standard functionality becomes underlined to
indicate errors. I am including some of the code from the main page
class and also from the ClientSidePage class:

From main page class -
Public Class manage_schedule
'Inherits System.Web.UI.Page
Inherits ClientSidePage
#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents calSchedDate As
System.Web.UI.WebControls.Calendar
Protected WithEvents dtgSchedule As
System.Web.UI.WebControls.DataGrid

Now errors like -
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init [Building the solution generates
the error 'Event init cannot be found']

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize thee page here
Dim dtChannels As DataTable
Dim oChnls As TwoFourTV.BO.Tabs [Building the solution generates
the error Event 'Load' cannot be found]

So basic events cannot be found once the ClientSidePage class is
included.

Here is the ClientSidePage class heading -
Public Class ClientSidePage
Inherits System.Web.UI.Page

Public Sub MonitorChanges(ByVal wc As WebControl)

If wc Is Nothing Then Exit Sub

Page.RegisterArrayDeclaration("monitorChangesID", """" & wc.ID &
"""")
Page.RegisterArrayDeclaration("monitorChangesValues", "null")

End Sub
Hope this helps.
 
D

D James

Not sure why but I've got it working now. I deleted the class and
reproduced it (identically) and now it's doing what it should, checking
data before allowing off the page.
 
Joined
Jun 13, 2007
Messages
1
Reaction score
0
Reproduce the class

Hi James,

I encounted the same problem as yours, can you tell the detail of how you "reproduced it"?

Thanks


D James said:
Not sure why but I've got it working now. I deleted the class and
reproduced it (identically) and now it's doing what it should, checking
data before allowing off the page.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top