473,789 Members | 3,123 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.p age.
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.p age code.
Can anyone help.
Nov 19 '05 #1
5 1332
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.p age.
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.p age 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******@4GuysF romRolla.com
http://www.4GuysFromRolla.com/ScottMitchell
Nov 19 '05 #2
Could you please send article link.

Thanks
Masoud
"Scott Mitchell [MVP]" <mi******@4guys fromrolla.com> wrote in message
news:hh******** *********@newss vr14.news.prodi gy.com...
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.p age.
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.p age 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******@4GuysF romRolla.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.P age
Inherits ClientSidePage
#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub
Protected WithEvents calSchedDate As
System.Web.UI.W ebControls.Cale ndar
Protected WithEvents dtgSchedule As
System.Web.UI.W ebControls.Data Grid

Now errors like -
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) 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.EventArg s) Handles MyBase.Load
'Put user code to initialize thee page here
Dim dtChannels As DataTable
Dim oChnls As TwoFourTV.BO.Ta bs [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.P age

Public Sub MonitorChanges( ByVal wc As WebControl)

If wc Is Nothing Then Exit Sub

Page.RegisterAr rayDeclaration( "monitorChanges ID", """" & wc.ID &
"""")
Page.RegisterAr rayDeclaration( "monitorChanges Values", "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
2833
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 Contact_telephone___BeforeUpdate(Cancel As Integer) Dim rs As DAO.Recordset Dim iAns As Integer Set rs = Me.RecordsetClone rs.FindFirst " = '" & Me! & "'" If Not rs.NoMatch Then
12
1735
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 ASPX interaction? How would I best build such pages. Many people of course don't want a page that they can't modify at all without programmer intervention. I think ASPX does this. Just curious to hear some comments on the subject from more...
0
2220
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. I need to store type, date, description, and total for each check/debit transaction as well as a balance and user settings. My problem is that I am learning vb.net now and I'm not ready to move into datbases yet so xml seems my only viable option,...
34
10848
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 VBA code that wrote the results of that away to the db, either creating new records or updating existing records, whichever was relevant. This may also include deleting records. Now I generally do this by opening a recordset on the source data...
3
2000
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 query. As an example, the Problem Solution column doesn't display and unless I comment out another column. Or if I move Problem Solution and it make ithe first column, then the Root Cause won't display. Here's the code: <%
1
1915
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 files transferred. Can only move a certain amount of files per time period. -Folders have a priority. The files have to be moved based on the folder priority.
10
4738
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 spawning a handfull of worker threads, then waiting for all of them to complete before moving on. I believe I used array of ManualResetEvents and the WaitAll() method to do this. All the worker threads used a shared object (a common place to collect...
125
6624
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 problem. http://www.jilp.org/vol9/v9paper10.pdf Specifically, they measured the overhead of a bounds
1
1846
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 select Check In and the comment box would appear allowing me to enter comments for my changes. Now when I right click the context menu has a Check In Now (Recursive) selection. When I select this option the file is committed to sourcesafe without...
0
9665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6768
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.