CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 6/16/2005 4:01:29 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 56 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
bobgarbados
Asp.Net User
Base Page Class and ObjectDataSource6/16/2005 4:01:29 PM

0/0

I have 20-some forms in my web app that all contain an employee and a client dropdownlist and an employee and client objectDataSource for populating the dropdownlists.  I have to perform the same operation on all forms for the objectDataSource_Selecting events and would like to implement this in a base class inheriting from Page that my individual pages can inherit from.

I put the following code in my class that inherits from Page:
<code>
Namespace myPage
    Public Class myFormPage
        Inherits System.Web.UI.Page

        Public WithEvents odsClient As ObjectDataSource
        Public WithEvents odsEmployee As ObjectDataSource

        Protected Overridable Sub odsClient_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles odsClient.Selecting
            If IsTimedOut() = True Then
                e.Cancel = True
            End If
        End Sub

        Protected Overridable Sub odsEmployee_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles odsEmployee.Selecting
            If IsTimedOut() = True Then
                e.Cancel = True
            End If
        End Sub

    Public Function IsTimedOut() As Boolean
            Try
                If Session.Item("isLoggedIn").ToString = "true" Then
                    Return False
                Else
                    Return True
                End If
            Catch ex As NullReferenceException
                Return True
            End Try
        End Function

    End Class
End Namespace
</code>

When I inherit from this class I get the following warnings:
1) withEvents variable 'odsClient' conflicts with withEvents variable 'odsClient' in the base class 'CorrectErrorsFormPage' and should be declared 'Shadows'
2) withEvents variable 'odsEmployee' conflicts with withEvents variable 'odsEmployee' in the base class 'CorrectErrorsFormPage' and should be declared 'Shadows'

What do I need to do to get rid of these warnings?  It seems to me that I need to change the way that the objectdatasources are declared in the code-beside, but I can't get to the code in the partial class for my code-beside that vis studio generates.

I would really like to implement a lot of common tasks in the myFormPage class because all of the forms share other controls as well.  Ideas? thanks.
bobgarbados
Asp.Net User
Re: Base Page Class and ObjectDataSource6/16/2005 7:59:53 PM

0/0

Is there a way to do what I'm trying to accomplish?  The event handlers in the base class don't fire when the derived class's odsClient and odsEmployee select their respective data...
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Professional ADO.NET 2: Programming with SQL Server 2005, Oracle, and MySQL Authors: Wallace B. McClure, Gregory A. Beamer, John J. Croft, John J. Croft, IV, J. Ambrose Little, Bill Ryan, Phil Winstanley, David Yack, Jeremy Zongker, Pages: 614, Published: 2005
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers Authors: Brennan Stehling, Pages: 408, Published: 2007
Programming Windows Presentation Foundation Authors: Chris Sells, Ian Griffiths, Pages: 447, Published: 2005
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007
Expert C# 2005 Business Objects Authors: Rockford Lhotka, Pages: 668, Published: 2006
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
Expert VB 2005 Business Objects Authors: Rockford Lhotka, Pages: 670, Published: 2006
Learning WCF: Master Windows Communication Foundation and Soa Fundamentals Authors: Michele Leroux Bustamante, Pages: 582, Published: 2007

Web:
Base Page Class and ObjectDataSource - ASP.NET Forums Base Page Class and ObjectDataSource. Last post 06-16-2005 3:59 PM by bobgarbados. 1 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Base Page Class and ObjectDataSource - ASP.NET Forums Re: Base Page Class and ObjectDataSource ... The event handlers in the base class don't fire when the derived class's odsClient and ...
Damo's spot on the web: ASP.NET: Binding the ObjectDataSource to ... Parent == null) { // User control was not found, use page base type instead this . .... In this example the data is stored in a property on the page class ...
ObjectDataSource.EnableCaching Property (System.Web.UI.WebControls) In the base implementation of the EmployeeLogic class, the GetAllEmployees ... the object completely to work with the ObjectDataSource on a Web Forms page, ...
Brian Orrell: ObjectDataSource / LINQ / Paging / Sorting Example ObjectDataSource.Business (Windows Class Library) and Pariveda. ... //Use the Skip and Take methods to limit the results to the page requested ...
Tobi + C# = T# » Trying to enhance ObjectDataSource Just override the method onObjectCreating of the base class ObjectDataSource in the new class AdapterDataSource. Well, if you look at the specs you will ...
Visoft, Inc. Blogs | ObjectDataSource, SOA Style Aug 18, 2008 ... public class WebServiceObjectDataSource : ObjectDataSource { public WebServiceObjectDataSource() : base() { ObjectCreating += new ...
ASPxScheduler Suite - K18043 - How to bind ASPxScheduler to ... Create a class responsible for data processing - CustomDataSource. ... Add the ObjectDataSource component to the page by dragging and dropping it from the ...
An ObjectDataSource/GridView Adapter for Business Entity ... Here’s a quick example of a derived class, that adpts my SomethingCollection to easily work with the GridView and ObjectDataSource. ...
Change / set ObjectDataSource paramater at runtime? - .NET C# NET page that displays a GridView control based on an ObjectDataSource control. I'm wondering if it's possible to base the ObjectDataSource ...




Search This Site:










sending email from a form

how do i set checkbox values to an array?

getting sql to lookup query strings

alert box keeps poping up

which language to choose? begginer of begginers

which is the better solution?

please help - retrieving session variable before pageload sub

dropdownlist not returning correct value?

exporting html to excel

a link that posts back the previous page

html (javascript) ---> asp ---> xml (saving data)

how to let asp.net read newest file, thanks!

meaning of this.........

visual web developer express 2008

response.writefile vs response.write

system.transfer ("newpage.aspx")

question about passing value to another page using global c#

date format conversion

dateformat..using asp.net

problems running asp.net code...

event registration website

how to: soap, javascrip, c# webservice.

postback flicker

passing variable to new page

i am getting error message "input validator not declared"

how to use datagrid templatecolumn in the code behind ?

caching

saving datarow to datatable doesn't work

learn asp.net

wiring up an httpmodule

  Privacy | Contact Us
All Times Are GMT