ASP.net 2 Master pages menu and saving pages - Weired situation - please help

A

Annie

Hi guys,

I am having a weired situation that don't know how to handle it ...
I have master pages, the master page contains a dynaic menu which is set up
in the database
and has page url, name, title etc.

The menu is loaded dynamically at run time. The problem that I have is that
once the users are selecting
any menu option (eg a link) i should manage to save current page content and
if the save was successful
then I need to redirect to selected page otherwise display the message ...

In this stage I have a base class (basepage) that all my pages inherits
from, and I also have an interface
IManageable that the base class implements it.

However, I am not sure how to implement this situation? How selection of one
menu option can save
the previous pages details (if any) then navigate

Any suggestion will be appreciated
 
C

Cowboy \(Gregory A. Beamer\)

Here is my first go at this:
The menu has to use ASP.NET link buttons instead of a direct postback. You
can then capture that event and save the data. This can be a generic
routine, in the base class, that you can call a method to save. If you need
to override this event in the page itself (extremely likely), you can do
that.
 
R

Ray Costanzo

Personally, if I wanted to do something like this, I'd just use some
client-side code to ask the user to confirm leaving the page if data has
changed. But, if you want to just automatically save the stuff, then your
nav links in your master page will have to be linkbuttons which will post
and execute whatever code is necessary in each of your pages in the
Page_Load in an if(Page.IsPostback) block.

Ray at work
 
C

Cowboy \(Gregory A. Beamer\)

The only downside here is if you use autopostback instead of AJAX on certain
controls (dropdowns that populate other controls comes to mind). If you
always have IsPostBack = true save the data, you will have to have a
validation routine to avoid saving half eaten data.
 
A

Annie

Hi guys,

I guess the problem I am having and can't figure out is that the Menu is
generated dynamically
it very possibly could be a treeview ... then I need to make sure that once
the link is clicked
if there is unsaved object then it should be saved ... then it should
redirect to new clicked page
each page can have its own BOC but they all hopefully will have a base class
....

I just can't set the object hierarchy and how the commuicate with the menu
and master pages

thanks for any tips
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top