473,320 Members | 2,029 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,320 software developers and data experts.

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

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
Apr 23 '07 #1
4 1588
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://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
"Annie" <my**************@gmail.comwrote in message
news:46******@dnews.tpgi.com.au...
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
Apr 23 '07 #2
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

"Annie" <my**************@gmail.comwrote in message
news:46******@dnews.tpgi.com.au...
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
Apr 23 '07 #3
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://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
"Ray Costanzo" <my first name at lane 34 dot commercialwrote in message
news:65**********************************@microsof t.com...
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

"Annie" <my**************@gmail.comwrote in message
news:46******@dnews.tpgi.com.au...
>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
Apr 23 '07 #4
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)" <No************@comcast.netNoSpamMwrote in
message news:34**********************************@microsof t.com...
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://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
"Annie" <my**************@gmail.comwrote in message
news:46******@dnews.tpgi.com.au...
>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

Apr 24 '07 #5

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

Similar topics

14
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a...
17
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
6
by: Ben Fidge | last post by:
Hi I've just created a new Master Page for my site and it uses the native Menu control. Strange behaviour is happening on page that use the master page. For some reason, the menu controls...
4
by: Janet | last post by:
Hi, I'm trying to use the master/detail page to display the information of staff. The master page will display some general information, while the differen detail pages will show the different...
2
by: n# | last post by:
I have an old existing website with a Header/ Left Hand Menu and a iframe as the main body content, adjacent to the menu. So for every click on the menu item, I used to load a aspx page on the...
0
by: Miaaa Mukherjee | last post by:
I m using ASP.Net with VB,C# in 2005 I want to use the master page and content pages. I m creating a project which contains a leftmenu,headercontrol of images,middle menu. I don't understand...
3
by: Adi | last post by:
Hi all, I have a menu which is placed in the master page. Now when the user clicks on one of the menu item, it fires an event which is handled in the master page. I need to know from which page...
10
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the...
5
by: Murray | last post by:
Forgive me if this question is too basic, but I'm new to ASP.NET programming, and I can't locate a simple answer to this question. I have a web page that consists of a Master Page and a single...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.