How to access sub from master page inside web user control?

i am adding this inside html of user control
<%@ MasterType VirtualPath="~/Site1.master" %>

then

in code behind of user control

    Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        Master.culturecode()
        c1.sendEmail("gbarraza@woodmizer.com", "gbarraza@woodmizer.com", Now.Millisecond, "welcome " + Thread.CurrentThread.CurrentCulture.ToString)

        LoadStrings(Thread.CurrentThread.CurrentCulture)
    End Sub
WiggingAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
>Master.culturecode()

And? What is happening? Did you try

Page.Master.culturecode()

?
0
 
WiggingAuthor Commented:
I think web user control does not like this below???

<%@ MasterType VirtualPath="~/Site1.master" %>
0
 
CodeCruiserCommented:
Why are you not setting the master page on the page that is hosting the user control?
0
 
Obadiah ChristopherConnect With a Mentor Commented:
Dim siteMaster As Site1 = TryCast(Me.Page.Master, Site1)

siteMaster.CultureCode()

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.