473,785 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom HyperLink Control

I need to create a custom control that behaves like a HyperLink control
EXCEPT where I can get into the events somewhere to programmaticall y decided
whether to actually perform the link request, or to refuse it.

Why? Because I want to use these links on forms that may have unsaved
changes - and I don't want them to lose the changes by clicking on the
hyperlink.

Unfortunately, I find the web controls bewildering. I would have thought
that if I just created a new type of HyperLink by inherting from a HyperLink
that I could just override the behavior of the base control and everything
would work. When I inherit from it, though, I get a generic control that
displays as pure text - nothing like a HyperLink.

1. Why is this? Why can't controls that inherit from the base web controls
simply override methods and otherwise behave identically to their base class
controls?

Since that didn't work, I tried to inherit from a Label control and override
the OnClick() event. No dice. It isn't in there.

So I tried to inherit from a Button and change the rendering - couldn't make
it work.

You'd think this would be easy. As a matter-of-fact, I would have thought
that Microsoft would have allowed for this simply by overriding events on
the page.

So...

2. Can anyone tell me what's going on here, the basics for inherting from a
..NET control and making it display and operate like its base class, and
where I should go from here?

Thanks in advance!
Nov 17 '05 #1
0 1335

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

Similar topics

2
1405
by: -=Chris=- | last post by:
Hello all, I've designed a custom bread crumb control for several of my asp.net projects. The default property of this control is a custom HyperLinkCollection I've created, which contains, you guessed it, HyperLink objects. All of it works great if I create/assign the links at runtime in code. I'd like to be able to assign links at design time, which is possible using the properties window, but currently, they do not carry over to the...
2
1071
by: Paul | last post by:
Hi I have a custom control that I am using as a menu on several web pages. I want the hyperlink to close any window the user is on, just wondering if this can be done with java script and how. I tried <script language="javascript" event="onclick()" for="Hyperlink"> window.close(); </script> but does not work. THanks. -- Paul G
3
1087
by: James T. | last post by:
Hello! I am developing a custom server control that inherits from Hyperlink web control. I defined 2 new properties - ImageWidth and ImageHeight. My qustion is, how I can override Render method so if Hyperling ImageUrl is set then add ImageWitdh and ImageHeight attributes to image. Thank you!
1
6102
by: Jeremy Chapman | last post by:
I have a property will an array of webcontrols. The control features a custom property editor which can add and remove web controls to the array, but how do I persist the informtion by serializing it to the aspx page? For example, right now, here is what the html looks like when I drag my control on to the page and add some web controls to the ControlList property:
19
4921
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the exception of custom Collection Classes. Background: I'm developing an A2K .mdb to be deployed as an .mde at my current job-site. It has several custom controls which utilize custom classes to wrap built-in controls, and add additional functionality....
0
3267
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design time. If I type the code in the aspx manually it does get parsed correctly though. This is an example of the aspx code that gets parsed correctly. For some reason, if I changed update the Tab property of the control through the GUI at design...
14
14659
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control so I get the ObjectDataSource. No problem ..... ObjectDataSource src = .... //is ok i have it
0
1560
by: LaptopHeaven | last post by:
I am having some trouble. How would one load a custom UserControl fro within a class which impements the ITemplate interface. Currently I have the following: public class SmallProductViewTemplate : ITemplate { public void InstantiateIn(Control container) { HyperLink productImage = new HyperLink();
4
1841
by: Jeff | last post by:
hi asp.net 2.0 I have created a custom web control, here is it's header: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="EditUserBox.ascx.cs" Inherits="Controls_EditUserBox" %> In another custom web user control, I use this web control: <%@ Register Src="~/Controls/EditUserBox.ascx" TagName="Eub" TagPrefix="mb"
0
9647
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
10356
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
10162
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
10100
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,...
0
8988
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
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
6744
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
5396
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
2893
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.