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

Discussion in 'ASP .Net' started by Annie, Apr 23, 2007.

  1. Annie

    Annie Guest

    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
    Annie, Apr 23, 2007
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
    >
    Cowboy \(Gregory A. Beamer\), Apr 23, 2007
    #2
    1. Advertising

  3. Annie

    Ray Costanzo Guest

    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" <> wrote in message
    news:...
    > 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
    >
    Ray Costanzo, Apr 23, 2007
    #3
  4. 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 commercial> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >> 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
    >>

    >
    Cowboy \(Gregory A. Beamer\), Apr 23, 2007
    #4
  5. Annie

    Annie Guest

    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)" <> wrote in
    message news:...
    > 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" <> wrote in message
    > news:...
    >> 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
    >>

    >
    Annie, Apr 24, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nedu N
    Replies:
    1
    Views:
    381
    Steven Cheng[MSFT]
    Jan 21, 2004
  2. Nedu N
    Replies:
    5
    Views:
    629
    Steven Cheng[MSFT]
    Mar 6, 2004
  3. Replies:
    1
    Views:
    3,202
    PeterKellner
    May 16, 2006
  4. Nedu N

    Server.Transfer in ASP.NET - weired problem

    Nedu N, Jan 20, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    140
    Steven Cheng[MSFT]
    Jan 21, 2004
  5. Nedu N

    Server.Transfer in ASP.NET - weired problem

    Nedu N, Jan 20, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    132
    Steven Cheng[MSFT]
    Jan 21, 2004
Loading...

Share This Page