Referencing a User Control from ASPX page

G

Guest

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_PhysiciansRelationsDetail" 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top