473,668 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing a User Control from ASPX page

VS2005 - How do I reference a User Control from the ASPX page that I have
placed the user control on? Here is the code I used from VS2003 and it
worked, but for VS2005 it gives me a null reference ie;
referenceUserCo ntrol.buttonReg ister("Save")
- this is a public method on the user control. How can I reference a user
control from the page its placed on?

Example:
<%@ Page Language="VB" MasterPageFile= "~/MasterPage.mast er"
AutoEventWireup ="false" CodeFile="Physi ciansRelationsD etail.aspx.vb"
Inherits="Admin PhysicianRelati ons_PhysiciansR elationsDetail" title="Untitled
Page" %>

<%@ Register Src="../PhysicianRegist rationUC.ascx"
TagName="Physic ianRegistration UC"
TagPrefix="uc2" %>

<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">
<uc2:PhysicianR egistrationUC ID="PhysicianRe gistrationUC1"
runat="server" />
</asp:Content>

Partial Class AdminPhysicianR elations_Physic iansRelationsDe tail
Inherits System.Web.UI.P age

Protected WithEvents referenceUserCo ntrol As
PhysicianPortal .PhysicianRegis trationUC

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load

If Not Page.IsPostBack Then
referenceUserCo ntrol.buttonReg ister("Save")

End If

End Sub
End Class
--
Chris Davoli

Aug 8 '06 #1
0 942

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

Similar topics

3
1571
by: DC Gringo | last post by:
I have an myPage.aspx with a myPage.ascx user control. The user control is the main header of the page. I have some conditional case code in the user control that I use which depends on a public variable "sectionID" set int he myPage.aspx's code-behind. How can I reference that variable in my control dynamically? I can hard card in the name of the myPage.aspx.vb class but that doesn't help me if the control is used within many different...
6
11276
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
3
1027
by: DC Gringo | last post by:
I have an myPage.aspx with a myPage.ascx user control. The user control is the main header of the page. I have some conditional case code in the user control that I use which depends on a public variable "sectionID" set int he myPage.aspx's code-behind. How can I reference that variable in my control dynamically? I can hard card in the name of the myPage.aspx.vb class but that doesn't help me if the control is used within many different...
3
1054
by: DC Gringo | last post by:
I have an myPage.aspx with a myPage.ascx user control. The user control is the main header of the page. I have some conditional case code in the user control that I use which depends on a public variable "sectionID" set int he myPage.aspx's code-behind. How can I reference that variable in my control dynamically? I can hard card in the name of the myPage.aspx.vb class but that doesn't help me if the control is used within many different...
3
245
by: DC Gringo | last post by:
I have an myPage.aspx with a myPage.ascx user control. The user control is the main header of the page. I have some conditional case code in the user control that I use which depends on a public variable "sectionID" set int he myPage.aspx's code-behind. How can I reference that variable in my control dynamically? I can hard card in the name of the myPage.aspx.vb class but that doesn't help me if the control is used within many different...
0
8791
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
8577
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
8653
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6206
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
4202
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...
0
4376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2786
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
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.