473,424 Members | 1,889 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,424 software developers and data experts.

Page inheritance problem

Jon
I have made the following class and want all my pages to inherit from it instead of system.web.ui.page. this works fine, except that now in the designer none of the controls have names and I get an error "Type Abstract" when I do switch to designer mode...

I can't use windows forms auth because we use frames and iframes on the site, and each of them gets redirected to the login page, instead of just the central content frame. If there's a way around that, I won't need to do the checking below...
Any ideas?
Here is the class they inherit from:

Public Class PageAuth
Inherits System.Web.UI.Page

Public Sub New()
AddHandler MyBase.Load, AddressOf Me.PageAuth_Load
End Sub

Private Sub PageAuth_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
AccessCheck()
End Sub

Private Sub AccessCheck()
Dim oTemp As Object

oTemp = Session("UserEmpNo")

If oTemp Is Nothing Then
Response.Redirect("login.aspx?s=NoSession", True)
End If

If CType(oTemp, String) = "" Then
Response.Redirect("login.aspx?s=NoSession", True)
End If
End Sub
End Class

--
********************************
Jon Rosenberg
Nov 19 '05 #1
2 858
Jon
I kinda worded this wrong. I understand that inheriting from my class instead of ui.page will cause this problem and there isn't a workaround. I should have asked more specifically about using Forms auth on a site that utilizes frames...

Any ideas on that?
"Jon" <ru******@msn.com> wrote in message news:10*************@corp.supernews.com...
I have made the following class and want all my pages to inherit from it instead of system.web.ui.page. this works fine, except that now in the designer none of the controls have names and I get an error "Type Abstract" when I do switch to designer mode...

I can't use windows forms auth because we use frames and iframes on the site, and each of them gets redirected to the login page, instead of just the central content frame. If there's a way around that, I won't need to do the checking below...
Any ideas?
Here is the class they inherit from:

Public Class PageAuth
Inherits System.Web.UI.Page

Public Sub New()
AddHandler MyBase.Load, AddressOf Me.PageAuth_Load
End Sub

Private Sub PageAuth_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
AccessCheck()
End Sub

Private Sub AccessCheck()
Dim oTemp As Object

oTemp = Session("UserEmpNo")

If oTemp Is Nothing Then
Response.Redirect("login.aspx?s=NoSession", True)
End If

If CType(oTemp, String) = "" Then
Response.Redirect("login.aspx?s=NoSession", True)
End If
End Sub
End Class

--
********************************
Jon Rosenberg
Nov 19 '05 #2
"Jon" <ru******@msn.com> wrote in message news:10*************@corp.supernews.com...
I have made the following class and want all my pages to inherit from it instead of system.web.ui.page. this works fine, except that now in the designer none of the controls have names and I get an error "Type Abstract" when I do switch to designer mode...
The designer does not support page inheritance for web forms, only for Windows Forms. You should not put UI elements on base pages because of this.

John Saunders

Nov 19 '05 #3

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

Similar topics

0
by: Dan | last post by:
I posted a similar post regarding problems with VS.NET design mode. I fixed that problem (with much thanks to this newsgroup) but now I have a second problem. I have created a class called...
5
by: Invalidlastname | last post by:
Hi, I just read the pattern "Design and Implementation Guidelines for Web Clients" from MSDN. Here is my question. In chapter 3,...
1
by: Andy Fish | last post by:
Hi, I have been thinking about the design of a large ASP.NET app and I've read people have a lot of trouble implementing front controller, especially with postbacks, so I don't feel comfortable...
7
by: tshad | last post by:
I have a control that I am using from Metabuilders that requires you to use: <%@ Page Inherits="MetaBuilders.WebControls.DialogPage" %> How do I inherit my code-behind page or another object...
3
by: Pini | last post by:
Hi all,In asp.net 1.x i creates a basepage that extends System.Web.UI.Page class. I created this file in a web appplcaition project and then refernced it from another projects. All the pages in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.