Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Using class in masterpage

$
0
0

Hi

I have a master page called basemasterpage which has a modalpopextender called mpuEmail

<asp:ContentPlaceHolder ID="mainContent" runat="server"><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:Panel ID="emailPanel" runat="server"><uc:emailPopup ID="ucemailPopup" runat="server" /></asp:Panel></ContentTemplate></asp:UpdatePanel><cc1:ModalPopupExtender ID="mpuEmail" runat="server" PopupControlID="emailPanel" TargetControlID="btnHdn"></cc1:ModalPopupExtender><asp:Button ID="btnHdn" runat="server" Text="Button" Visible="false" /></asp:ContentPlaceHolder>

basemasterpage has a class in its code behind

Public Class MyMaster
    Inherits BaseMasterPage
    Public Sub ShowModal(showHide As String)
        If showHide = "Show" Then
            mpuEmail.Show()
        ElseIf showHide = "Hide" Then
            mpuEmail.Hide()
        End If
    End Sub

And in temp.aspx.vb i have the following sub

 

  Public Sub ShowModal(showhide As String)
        Dim masterPage As MyMaster = TryCast(Page.Master, MyMaster)
        masterPage.ShowModal(showhide)
    End Sub


Finally on a button click also in temp.aspx.vb, I have the following code

Protected Sub Button1_Click(sender As Object, e As EventArgs)
        ShowModal("Hide")


    End Sub

I get an object not set to an instance error on the masterPage.ShowModal(showhide)  line.

 

Any ideas?

Thank you so much i've been on this for hours.

 

Leonaisse

 



 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>