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
hysicianRegistrationUC 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
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
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