Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2012-08-14
4
Medium Priority
?
586 Views
Last Modified: 2012-08-31
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
0
Comment
Question by:Wigging
  • 2
4 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1000 total points
ID: 38294075
>Master.culturecode()

And? What is happening? Did you try

Page.Master.culturecode()

?
0
 

Author Comment

by:Wigging
ID: 38297447
I think web user control does not like this below???

<%@ MasterType VirtualPath="~/Site1.master" %>
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38297582
Why are you not setting the master page on the page that is hosting the user control?
0
 
LVL 20

Assisted Solution

by:informaniac
informaniac earned 1000 total points
ID: 38333669
Dim siteMaster As Site1 = TryCast(Me.Page.Master, Site1)

siteMaster.CultureCode()

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Loops Section Overview
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

804 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question