473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

checking data before allowing user to move on

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.
Nov 19 '05 #1
5 1316
D James wrote:
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]
mi******@4GuysFromRolla.com
http://www.4GuysFromRolla.com/ScottMitchell
Nov 19 '05 #2
Could you please send article link.

Thanks
Masoud
"Scott Mitchell [MVP]" <mi******@4guysfromrolla.com> wrote in message
news:hh*****************@newssvr14.news.prodigy.co m...
D James wrote:
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]
mi******@4GuysFromRolla.com
http://www.4GuysFromRolla.com/ScottMitchell

Nov 19 '05 #3
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("monitorChangesValue s", "null")

End Sub
Hope this helps.

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

http://aspnet.4guysfromrolla.com/articles/101304-1.aspx
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #5
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!
Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: R Bolling | last post by:
I am using a routine to check to see if a phone number (PK) has alread been entered, and takes the user to that record if it is found -- as follows: Private Sub...
12
by: SStory | last post by:
Doing pages for contract..... If I make an ASPX file that does certain things, how simple would it be for a person who know nothing about it to modify the user interface without bothering the...
0
by: Harley | last post by:
I am trying to write a personal app to keep a bank balance and history. The problem I'm haveing is finding a decent way to store the data on a pocketpc under .net compact framewok useing vb.net....
34
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have...
3
by: dale.zjc | last post by:
I've got some bizarre behavior going on with my ASP code below. For some strange reason (and I'm a newbie to ASP so it's probably obvious to others) I can't display all the rows of data from the...
1
by: halcyon943 | last post by:
have 4 folders that I watch and need to move files from to another location. Three constraints: -Finish time. Make sure the program stops transferring files at a specific time -Number of...
10
by: David | last post by:
I am trying to get this straight in my head so I can implement. I wrote a small utility some time ago in c# that utilized a handful of threads. That scenario was one main thread manually...
125
by: jacob navia | last post by:
We hear very often in this discussion group that bounds checking, or safety tests are too expensive to be used in C. Several researchers of UCSD have published an interesting paper about this...
1
nateraaaa
by: nateraaaa | last post by:
In some way or another my Visual Studio context menu has changed and will not allow me to enter comments for my changes before checking the file into sourcesafe. I used to be able to right click and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.