Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to set NavigateUrl of an asp:MenuItem when moving from QA toPROD?

Reply
Thread Tools

How to set NavigateUrl of an asp:MenuItem when moving from QA toPROD?

 
 
MDaisy
Guest
Posts: n/a
 
      06-14-2009
It is customary that the MenuItem NavigateUrl values either in a
sitemap file or in a database.
However, unfortunately, the consulting company that is developing the
software package for the company that I work for has all menu items
inline and hard-coded.
I cannot change their menu implementation because they won't let me
change it.

Anyway, there is currently a menu item called Tools and under it there
is a Search menu item
I need to add an additional menu item with a NavigateUrl that points
to SQL Server Report Manager so it changes when going from dev, to
qa and to prod.
Question: Is there a way for me to code a key in appsettings section
of web.config and plug it as NavigateUrl for my additional menu item?
web.config can be edited when promoting to another environment without
having to compile the application.

The menu is hard-coded in the master page of the entire web
application.
<asp:MenuItem Text="Tools" Selectable="false" >

<asp:MenuItem Text="Search" NavigateUrl="~/
Search.aspx"></asp:MenuItem>

thank you.
 
Reply With Quote
 
 
 
 
Joern Schou-Rode
Guest
Posts: n/a
 
      06-14-2009
On Sun, 14 Jun 2009 03:36:14 +0200, MDaisy <(E-Mail Removed)>
wrote:

> Question: Is there a way for me to code a key in appsettings section
> of web.config and plug it as NavigateUrl for my additional menu item?
> web.config can be edited when promoting to another environment without
> having to compile the application.


In your markup (page or user control):
<asp:MenuItem Text="Reports" NavigateUrl="<%$ AppSettings:ReportServerUrl
%>" />

In your web.config, in the appSettings section:
<add key="ReportServerUrl" value="http://example.org/" />

--
Joern Schou-Rode
http://malamute.dk/
 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      06-15-2009
MDaisy <(E-Mail Removed)> wrote in news:6c6e21f2-39aa-419c-8dbc-
http://www.velocityreviews.com/forums/(E-Mail Removed):

> It is customary that the MenuItem NavigateUrl values either in a
> sitemap file or in a database.
> However, unfortunately, the consulting company that is developing the
> software package for the company that I work for has all menu items
> inline and hard-coded.
> I cannot change their menu implementation because they won't let me
> change it.
>
> Anyway, there is currently a menu item called Tools and under it there
> is a Search menu item
> I need to add an additional menu item with a NavigateUrl that points
> to SQL Server Report Manager so it changes when going from dev, to
> qa and to prod.
> Question: Is there a way for me to code a key in appsettings section
> of web.config and plug it as NavigateUrl for my additional menu item?
> web.config can be edited when promoting to another environment without
> having to compile the application.
>
> The menu is hard-coded in the master page of the entire web
> application.
> <asp:MenuItem Text="Tools" Selectable="false" >
>
> <asp:MenuItem Text="Search" NavigateUrl="~/
> Search.aspx"></asp:MenuItem>
>
> thank you.



Jeorn has given you a way to hard code in pointers. Another way to
accomplish this is to create your own custom provider to feed the menu.
I would personally opt for the custom direction in most cases, as it is
more flexible and better decouples the UI from the data. If you do not
expect any changes in the basic flow of the menu, however, it may be
overkill, esp. the first time (due to learning curve).


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Free Moving Estimate, Local Movers, Long Distance Moving, PackingSupplies, Storage Rental, Home Moving, Apartment Moving, Office Moving,Commercial Moving linkswanted ASP .Net 0 01-06-2008 04:45 AM
Moving to California Moving to L.A linkswanted Digital Photography 3 01-05-2008 04:22 PM
movers los angeles moving storage services movers in L.A companymoving companies moving in calfornia los angeles linkswanted HTML 0 12-21-2007 10:55 PM



Advertisments