Advertisement

03.04.2008 at 04:42PM PST, ID: 23214634 | Points: 500
[x]
Attachment Details

Accessing a value in a .master page from a class

Tags: ASP.NET 2.0, VB.NET
Hello All,

I am trying to access the value of a dropdown list that is in my .master page from a function.  

I've found some instruction which gets me close (I hope).  The only piece that gives me trouble is specifying the master page to use -- "Page.Master" or "Me.Master" doesn't work since I'm this function does not reside in a nested page.  The message I get now (about Page.Master) is: "Reference to a non-shared member requires an object reference".

How can I resolve this so that I am able to get the dropdowns selected item?  Thanks in advance.

Here is the code on my .master.vb page:

Public Property IdentityText() As String
Get
Return AlternateID.SelectedValue
End Get
End Property

This is from my function (securityaccess.vb):

Dim Master As MasterPage = Page.Master
Dim Dropdown As DropDownList = master.FindControl("AlternateID")
Dim ID As String = Dropdown.SelectedValue.ToString
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: kscrib
Question Asked On: 03.04.2008
Participating Experts: 1
Points: 500
Views: 0
Translate:
Loading Advertisement...
03.04.2008 at 05:30PM PST, ID: 21046971

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 05:43PM PST, ID: 21047033

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 05:53PM PST, ID: 21047098

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.05.2008 at 09:55AM PST, ID: 21052655

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.05.2008 at 10:35AM PST, ID: 21053044

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628