473,473 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calling sub procedure in MasterPage file

Hello,

In my codebehind file, I am trying to call a sub procedure that is in my
MasterPage, but I am getting an error:

Error 1: BC30451: Name 'LoadMenu' is not declared.
c:\inetpub\wwwroot\price_insx\MenuCode.aspx.vb 19

----
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Me.Load

If Not IsPostBack Then
Call LoadMenu("Hello World")
End If

End Sub
---

In my MasterPage:

Public Sub LoadMenu(ByVal strText As String)
Response.Write(strText)
End Sub

Any help with this would be appreciated.

--
Thanks in advance,

Steven
Nov 18 '05 #1
1 2159
Say your master page is called "Primary.master"
you could do

ctype(Master, Primary_master).LoadMenu

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Steven K" <sk****@troop.com> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Hello,

In my codebehind file, I am trying to call a sub procedure that is in my
MasterPage, but I am getting an error:

Error 1: BC30451: Name 'LoadMenu' is not declared.
c:\inetpub\wwwroot\price_insx\MenuCode.aspx.vb 19

----
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Me.Load

If Not IsPostBack Then
Call LoadMenu("Hello World")
End If

End Sub
---

In my MasterPage:

Public Sub LoadMenu(ByVal strText As String)
Response.Write(strText)
End Sub

Any help with this would be appreciated.

--
Thanks in advance,

Steven

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Earl | last post by:
If calling an exe that accesses a database from an ASP page, does the Provider string to connect to the database from inside the exe need to have the user as being "IUSR..." or something since it...
30
by: Tim Marshall | last post by:
Here's the scenario, A2003, Jet back end, illustrated with some cut down code at the end of the post: A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens it. There are several...
2
by: Arjen | last post by:
Hi, My mastepage can use two css files. Now page 1 needs to use the masterpage with css file 1 and page 2 needs to use the masterpage with css file 2. How can the page say that it wants to...
5
by: sck10 | last post by:
Hello, I am converting a class in the App_Code folder from c# to vb and am having problems calling the sub procedure. I have created a Sub called HidePanels in the class "General". When I try...
4
by: paul1664 | last post by:
Hi, I'm currently loading my masterpage from a file via an httpmodule. How can I modify this code to load the masterpage from a database? Is the only way to save the file to a temp file first...
8
by: BiffMaGriff | last post by:
Hello, I am using VS2005 to code webapps using C#. I am trying to call the javascript function alert() from my codebehind. I am using master pages and AJAX. My page structure is as follows: ...
4
by: Torben Laursen | last post by:
I want to change the label of a component that I have on a masterpage but I cannot get my hands on it I have a mastepage MP2 that has a button called B2 masterpage MP2 uses masterpage MP1 that has...
2
by: baburk | last post by:
Hi all, when I call the javascript method from code behind file of the same page it works fine. ScriptManager.RegisterClientScriptBlock(this, Page.GetType(), "Scroll",...
4
by: Christiano Donke | last post by:
Hello... I have this UserControl (login.ascx -Login), that is placed in a Masterpage (Layout.master -Layout). How can I call a sub (RedrawMenu) that is place in the code-behind of the master...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.