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

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

Post by Anni » Tue, 24 Apr 2007 21:41:18


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
 
 
 

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

Post by Gregory A. » Tue, 24 Apr 2007 22:14:10

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.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://www.yqcomputer.com/

*********************************************
Think outside the box!
*********************************************

 
 
 

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

Post by Ray Costan » Tue, 24 Apr 2007 22:28:15

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
 
 
 

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

Post by Gregory A. » Tue, 24 Apr 2007 22:39:40

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.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://www.yqcomputer.com/

*********************************************
Think outside the box!
*********************************************
 
 
 

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

Post by Anni » Wed, 25 Apr 2007 21:16:48

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


"Cowboy (Gregory A. Beamer)" < XXXX@XXXXX.COM > wrote in