Link Button Menu, Master page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt

    #1

    Link Button Menu, Master page

    On my master page i have build 5 link buttons. First Page I receive ID
    and set the ID in master page Property so i can do the work with it.
    How ever when i clicked to second button i lose this ID.
    How would i keep this ID thru these 5 pages. so i wont lose this ID..

    Master.page
    link1 link2 link3,
    public string AppID
    {
    get { return Label1.Text; }
    set { Label1.Text = value;}
    }
    page1.aspx
    Response.write( Master.AppID); // I have the ID to work with it..
    MyFunc(Master.A ppID);


    page2.aspx
    When i click on link2 on master page, i come page2 and i dont have
    this
    Master.AppID
    even though i have
    <%@ MasterType virtualpath="~/MyMaster.master " %referance on aspx
    page...

    How can i carry out this ID thru all the link click..

  • Ben Rush

    #2
    Re: Link Button Menu, Master page

    You should store the ID in session.

    Me.Session.Add( ), etc.

    If this is unacceptable for some reason and you never leave the page then
    you can look at using ViewState.

    Me.ViewState.Ad d(), etc.

    Let me know if this helps.

    --
    ~~~~~~~~~~~
    Ben Rush



    "Matt" <metehanIT@Hotm ail.comwrote in message
    news:1175926987 .739822.242700@ q75g2000hsh.goo glegroups.com.. .
    On my master page i have build 5 link buttons. First Page I receive ID
    and set the ID in master page Property so i can do the work with it.
    How ever when i clicked to second button i lose this ID.
    How would i keep this ID thru these 5 pages. so i wont lose this ID..
    >
    Master.page
    link1 link2 link3,
    public string AppID
    {
    get { return Label1.Text; }
    set { Label1.Text = value;}
    }
    page1.aspx
    Response.write( Master.AppID); // I have the ID to work with it..
    MyFunc(Master.A ppID);
    >
    >
    page2.aspx
    When i click on link2 on master page, i come page2 and i dont have
    this
    Master.AppID
    even though i have
    <%@ MasterType virtualpath="~/MyMaster.master " %referance on aspx
    page...
    >
    How can i carry out this ID thru all the link click..
    >

    Comment

    • Matt

      #3
      Re: Link Button Menu, Master page

      They might move the application on farm later so i did not wanted deal
      with session or cookies.
      Though i will try view state.. Thanks for that.
      I am confuse that i cant receive the master page property on second
      page / link
      Master.AppID is getting me the value though i have it available on
      intellisense

      Would there be a better design or solution for this..
      Create 5 link/job page. Do the jobs on those pages for that ID..


      Comment

      • Matt

        #4
        Re: Link Button Menu, Master page

        On Apr 7, 2:44 am, "Matt" <meteha...@Hotm ail.comwrote:
        They might move the application on farm later so i did not wanted deal
        with session or cookies.
        Though i will try view state.. Thanks for that.
        I am confuse that i cant receive the master page property on second
        page / link
        Master.AppID is getting me the value though i have it available on
        intellisense
        >
        Would there be a better design or solution for this..
        Create 5 link/job page. Do the jobs on those pages for that ID..

        Since this is second link second page, I dont have the ViewState
        information on second page
        view state is no good

        Comment

        • Ben Rush

          #5
          Re: Link Button Menu, Master page

          Okay, well, I can only assume I'm following what's going on/what you're
          trying to do.

          Remember that pages are rebuilt each time by the ASP.Net runtime you make a
          page request - that means that if you go to another page, even if it uses
          the "same" master page, it's really a completely seperate instance of that
          master page class - so you're really doing no good by setting property
          values on that class because the second time everything will have been
          recreated for you by scratch.

          I haven't done much server farm development so someone else might offer a
          better solution, but maybe store something in your query string?

          Again, I'm not totally following every inch of what your'e trying to do. I'm
          not as good when the code isn't right in front of me....

          --
          ~~~~~~~~~~~
          Ben Rush



          "Matt" <metehanIT@Hotm ail.comwrote in message
          news:1175928666 .517216.185940@ q75g2000hsh.goo glegroups.com.. .
          On Apr 7, 2:44 am, "Matt" <meteha...@Hotm ail.comwrote:
          >They might move the application on farm later so i did not wanted deal
          >with session or cookies.
          >Though i will try view state.. Thanks for that.
          >I am confuse that i cant receive the master page property on second
          >page / link
          >Master.AppID is getting me the value though i have it available on
          >intellisense
          >>
          >Would there be a better design or solution for this..
          >Create 5 link/job page. Do the jobs on those pages for that ID..
          >
          >
          Since this is second link second page, I dont have the ViewState
          information on second page
          view state is no good
          >

          Comment

          • Matt

            #6
            Re: Link Button Menu, Master page

            On Apr 7, 3:02 am, "Ben Rush" <kwen...@yahoo. comwrote:
            Okay, well, I can only assume I'm following what's going on/what you're
            trying to do.
            >
            Remember that pages are rebuilt each time by the ASP.Net runtime you make apagerequest - that means that if you go to anotherpage, even if it uses
            the "same"masterpag e, it's really a completely seperate instance of thatmasterpagec lass - so you're really doing no good by setting property
            values on that class because the second time everything will have been
            recreated for you by scratch.
            >
            I haven't done much server farm development so someone else might offer a
            better solution, but maybe store something in your query string?
            >
            Again, I'm not totally following every inch of what your'e trying to do. I'm
            not as good when the code isn't right in front of me....
            >
            --
            ~~~~~~~~~~~
            Ben Rushhttp://www.ben-rush.net/blog
            >
            "Matt" <meteha...@Hotm ail.comwrote in message
            >
            news:1175928666 .517216.185940@ q75g2000hsh.goo glegroups.com.. .
            >
            >
            >
            On Apr 7, 2:44 am, "Matt" <meteha...@Hotm ail.comwrote:
            They might move the application on farm later so i did not wanted deal
            with session or cookies.
            Though i will try view state.. Thanks for that.
            I am confuse that i cant receive themasterpagepr operty on second
            >page/link
            >Master.AppID is getting me the value though i have it available on
            intellisense
            >
            Would there be a better design or solution for this..
            Create 5link/jobpage. Do the jobs on those pages for that ID..
            >
            Since this is secondlink secondpage, I dont have the ViewState
            information on secondpage
            view state is no good- Hide quoted text -
            >
            - Show quoted text -
            Appricate the help. I try to keep it in xml and carry it over the
            request. Since i have been asked to hide the query sting..

            Comment

            • 9-11 Was An Inside Job

              #7
              Re: Link Button Menu, Master page

              // Submit this search term to google...
              profile overview site:msdn2.micr osoft.com

              --
              <%= Clinton Gallagher
              NET csgallagher AT metromilwaukee. com
              URL http://clintongallagher.metromilwaukee.com/


              "Matt" <metehanIT@Hotm ail.comwrote in message
              news:1175952964 .908667.67370@y 80g2000hsf.goog legroups.com...
              On Apr 7, 3:02 am, "Ben Rush" <kwen...@yahoo. comwrote:
              >Okay, well, I can only assume I'm following what's going on/what you're
              >trying to do.
              >>
              >Remember that pages are rebuilt each time by the ASP.Net runtime you make
              >apagerequest - that means that if you go to anotherpage, even if it uses
              >the "same"masterpag e, it's really a completely seperate instance of
              >thatmasterpage class - so you're really doing no good by setting property
              >values on that class because the second time everything will have been
              >recreated for you by scratch.
              >>
              >I haven't done much server farm development so someone else might offer a
              >better solution, but maybe store something in your query string?
              >>
              >Again, I'm not totally following every inch of what your'e trying to do.
              >I'm
              >not as good when the code isn't right in front of me....
              >>
              >--
              >~~~~~~~~~~~
              >Ben Rushhttp://www.ben-rush.net/blog
              >>
              >"Matt" <meteha...@Hotm ail.comwrote in message
              >>
              >news:117592866 6.517216.185940 @q75g2000hsh.go oglegroups.com. ..
              >>
              >>
              >>
              On Apr 7, 2:44 am, "Matt" <meteha...@Hotm ail.comwrote:
              >They might move the application on farm later so i did not wanted deal
              >with session or cookies.
              >Though i will try view state.. Thanks for that.
              >I am confuse that i cant receive themasterpagepr operty on second
              >>page/link
              >>Master.AppI D is getting me the value though i have it available on
              >intellisense
              >>
              >Would there be a better design or solution for this..
              >Create 5link/jobpage. Do the jobs on those pages for that ID..
              >>
              Since this is secondlink secondpage, I dont have the ViewState
              information on secondpage
              view state is no good- Hide quoted text -
              >>
              >- Show quoted text -
              >
              Appricate the help. I try to keep it in xml and carry it over the
              request. Since i have been asked to hide the query sting..
              >

              Comment

              Working...