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

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;
referenceUserControl.buttonRegister("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.master"
AutoEventWireup="false" CodeFile="PhysiciansRelationsDetail.aspx.vb"
Inherits="AdminPhysicianRelations_PhysiciansRelati onsDetail" title="Untitled
Page" %>

<%@ Register Src="../PhysicianRegistrationUC.ascx"
TagName="PhysicianRegistrationUC"
TagPrefix="uc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<uc2:PhysicianRegistrationUC ID="PhysicianRegistrationUC1"
runat="server" />
</asp:Content>

Partial Class AdminPhysicianRelations_PhysiciansRelationsDetail
Inherits System.Web.UI.Page

Protected WithEvents referenceUserControl As
PhysicianPortal.PhysicianRegistrationUC

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

If Not Page.IsPostBack Then
referenceUserControl.buttonRegister("Save")

End If

End Sub
End Class
--
Chris Davoli

Aug 8 '06 #1
0 940

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

Similar topics

3
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...
6
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"...
3
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...
3
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...
3
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.