473,327 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

How to finish this property?

I have the property below. What I need to do is access the asp.net Menu
controls MenuItems in a content page that are on a master page. I need to
set the Enabled state to false when the page loads and re enable it when the
page goes to the next one. Any ideas how to finish this one? Or if I got it
wrong?

//return the main menu so other pages can use it.

public Menu Menu {

get { return MainMenu; }

set { }

}
Nov 16 '07 #1
3 1230
Andy,

Perhaps a set property isn't such a good idea? It might be a better
idea to get the menu passed to you through a method and perform your
operations through there.

Are you asking how to access the Menu in the property (through the value
keyword) or are you asking how to set all those properties on the Menu
instance?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andy B" <a_*****@sbcglobal.netwrote in message
news:eS**************@TK2MSFTNGP05.phx.gbl...
>I have the property below. What I need to do is access the asp.net Menu
controls MenuItems in a content page that are on a master page. I need to
set the Enabled state to false when the page loads and re enable it when
the page goes to the next one. Any ideas how to finish this one? Or if I
got it wrong?

//return the main menu so other pages can use it.

public Menu Menu {

get { return MainMenu; }

set { }

}

Nov 16 '07 #2
I don't think you need to accept a Menu from elsewhere ( assumes MainMenu is
contructed in this class). If you have one and return a reference to it,
then the caller of your property can do anything to your menu that they need
to do.

In short- do you NEED a "set"? If you do, then it's set {MainMenu = value;}

"Andy B" <a_*****@sbcglobal.netwrote in message
news:eS**************@TK2MSFTNGP05.phx.gbl...
>I have the property below. What I need to do is access the asp.net Menu
controls MenuItems in a content page that are on a master page. I need to
set the Enabled state to false when the page loads and re enable it when
the page goes to the next one. Any ideas how to finish this one? Or if I
got it wrong?

//return the main menu so other pages can use it.

public Menu Menu {

get { return MainMenu; }

set { }

}


Nov 16 '07 #3
I found something for aspx files: <%@ MasterType
VirtualPath="MasterPage.master" %>. The problem is when I run it I have the
following problem: parser error: The file 'MasterPage.master' doesn't exist.
My MasterPage is called Layout.master. Even when I try the virtual path as
the actual file name, it says no circular references allowed. Any ideas why
it doesnt work?

When I get it to work I should be able to do something like:
MasterPageName.MainMenu //whatever to the main menu
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:4E**********************************@microsof t.com...
Andy,

Perhaps a set property isn't such a good idea? It might be a better
idea to get the menu passed to you through a method and perform your
operations through there.

Are you asking how to access the Menu in the property (through the
value keyword) or are you asking how to set all those properties on the
Menu instance?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andy B" <a_*****@sbcglobal.netwrote in message
news:eS**************@TK2MSFTNGP05.phx.gbl...
>>I have the property below. What I need to do is access the asp.net Menu
controls MenuItems in a content page that are on a master page. I need to
set the Enabled state to false when the page loads and re enable it when
the page goes to the next one. Any ideas how to finish this one? Or if I
got it wrong?

//return the main menu so other pages can use it.

public Menu Menu {

get { return MainMenu; }

set { }

}


Nov 16 '07 #4

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

Similar topics

5
by: Boris Nikolaevich | last post by:
This is backwards of what I usually want--normally if you have a long-running ASP script, it's a good idea to check to see whether the client is still connected so you can cancel execution. ...
39
by: jabailo | last post by:
I am looping through a text file, and with each row, I launch a web service, asynchronously. Before I move on to the next step in the process, I want to make sure that all the web services have...
2
by: Jordan S | last post by:
I have written a small Console application that executes the following line, amongst other things: System.Diagnostics.Process.Start(currentWorkingDirectory + @"\backup_files.cmd"); My Console...
11
by: Peter Kirk | last post by:
Hi there I am looking at using a thread-pool, for example one written by Jon Skeet (http://www.yoda.arachsys.com/csharp/miscutil/). Can anyone tell me if this pool provides the possibility to...
2
by: yxq | last post by:
Hi When a sub-Form are loading, how to know the sub-Form has been loaded to finish(all work end)? I wrote the code ********************************************* Me.Cursor =...
6
by: theGreatGnu | last post by:
Hi all, I am new to PHP, Apache and Mysql. But I least I have managed to install everything on my home computer on my own and everything is up and running. I can fetch data from the database and...
4
by: Dylan Parry | last post by:
Hi folks, I'm writing a program that needs to execute an external program and wait for it to finish running before it can make use of the output from that program. Specifically, the external...
0
by: mamod20 | last post by:
Please advise, I have the following example and want to know the best way to use $dbh->disconnect; and $sth->finish; -------------- $sql_host="localhost"; $sql_dataname = "database";...
1
by: Craig Coope | last post by:
I may be barking up the wrong tree here (maybe I can do all this in Excel) but... I have created an Excel sheet that lets me input job start and finish times and the amount of work done within...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.