Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to pass values to another aspx page without redirecting to that page?

how to pass values to another aspx page without redirecting to that page?

Scheduled Pinned Locked Moved ASP.NET
sysadmintutorialquestion
10 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dittu7
    wrote on last edited by
    #1

    i'm newbee. i tried to pass values but every time i'm usint server.transfer or response.redirect. is is possible to pass the values to that page without displaying that page.

    L D 2 Replies Last reply
    0
    • D dittu7

      i'm newbee. i tried to pass values but every time i'm usint server.transfer or response.redirect. is is possible to pass the values to that page without displaying that page.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      For that you need to use Session. Once you store value in Session you can use it on any page. There are many alternatives of session, Like you can use cookies, Application object or Cache. HTH

      Jinal Desai - LIVE Experience is mother of sage....

      D 1 Reply Last reply
      0
      • L Lost User

        For that you need to use Session. Once you store value in Session you can use it on any page. There are many alternatives of session, Like you can use cookies, Application object or Cache. HTH

        Jinal Desai - LIVE Experience is mother of sage....

        D Offline
        D Offline
        dittu7
        wrote on last edited by
        #3

        yes what you said is correct. but can you tell me how to send to that page with out calling that page. actually my problem is : i'm having two aspx pages namely page1 and page2 page1 has 'print' button and checkbox. so i need to send the information to page2 when print button is clicked whether checkbox is checked or not? so can you please elaborate your answer. thank you very much. regards, dittu

        L A 2 Replies Last reply
        0
        • D dittu7

          yes what you said is correct. but can you tell me how to send to that page with out calling that page. actually my problem is : i'm having two aspx pages namely page1 and page2 page1 has 'print' button and checkbox. so i need to send the information to page2 when print button is clicked whether checkbox is checked or not? so can you please elaborate your answer. thank you very much. regards, dittu

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          ok I got your point. But without calling the page it is not possible to pass the value. (It is possible to call page methods using AJAX, but that is for the same page.) Because when you call the page, the page is compiled at the same time, not before or after. So I think it is not possible. HTH

          Jinal Desai - LIVE Experience is mother of sage....

          1 Reply Last reply
          0
          • D dittu7

            yes what you said is correct. but can you tell me how to send to that page with out calling that page. actually my problem is : i'm having two aspx pages namely page1 and page2 page1 has 'print' button and checkbox. so i need to send the information to page2 when print button is clicked whether checkbox is checked or not? so can you please elaborate your answer. thank you very much. regards, dittu

            A Offline
            A Offline
            Anurag Gandhi
            wrote on last edited by
            #5

            You can use QueryString or CrossPage PostBack for this purpose. Just google it. You will get a lot of examples and codes.

            dittu7 wrote:

            how to send to that page with out calling that page.

            BTW, what do mean by without calling that page?

            Anurag Gandhi.
            http://www.gandhisoft.com
            Life is a computer program and every one is the programmer of his own life.

            D 1 Reply Last reply
            0
            • A Anurag Gandhi

              You can use QueryString or CrossPage PostBack for this purpose. Just google it. You will get a lot of examples and codes.

              dittu7 wrote:

              how to send to that page with out calling that page.

              BTW, what do mean by without calling that page?

              Anurag Gandhi.
              http://www.gandhisoft.com
              Life is a computer program and every one is the programmer of his own life.

              D Offline
              D Offline
              dittu7
              wrote on last edited by
              #6

              what exactly i was asking is how to send a value from page1 to page2 with out redirect to page2. if we use query string we write as: in page1: Server.Transfer("page2.aspx?value=checked") in page2: string str= Request.QueryString("value") in the above senario page2 is displaying on the browser which should not occur. so kindly you please send me some suggestions for that thanks dittu

              L R A 3 Replies Last reply
              0
              • D dittu7

                what exactly i was asking is how to send a value from page1 to page2 with out redirect to page2. if we use query string we write as: in page1: Server.Transfer("page2.aspx?value=checked") in page2: string str= Request.QueryString("value") in the above senario page2 is displaying on the browser which should not occur. so kindly you please send me some suggestions for that thanks dittu

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                That is what I am telling in my last post. It is not possible. We cannot get compiled page without transferring control to it. So we cannot process it without calling it. HTH

                Jinal Desai - LIVE Experience is mother of sage....

                1 Reply Last reply
                0
                • D dittu7

                  what exactly i was asking is how to send a value from page1 to page2 with out redirect to page2. if we use query string we write as: in page1: Server.Transfer("page2.aspx?value=checked") in page2: string str= Request.QueryString("value") in the above senario page2 is displaying on the browser which should not occur. so kindly you please send me some suggestions for that thanks dittu

                  R Offline
                  R Offline
                  raju melveetilpurayil
                  wrote on last edited by
                  #8

                  then why you use page2? i think you want to call some function from Page2 to Page1 page class are public partial class. so you can call that from Page1 for example public partial class _Page1() { PageLoad() { _Page2 objPage2=new _Page2(); DataTable dt=objPage2.BindData(false); } } public partial class _Page2() { DataTable BindData(bool x) { } } But this is not a good practice

                  Raju.M

                  1 Reply Last reply
                  0
                  • D dittu7

                    i'm newbee. i tried to pass values but every time i'm usint server.transfer or response.redirect. is is possible to pass the values to that page without displaying that page.

                    D Offline
                    D Offline
                    dittu7
                    wrote on last edited by
                    #9

                    thank you very much to every one who given reply. now i got that using sessions with out displaying the page2.. even though this is my first post i'm really encouraged with all your support... :) thank you dittu :cool: :thumbsup:

                    1 Reply Last reply
                    0
                    • D dittu7

                      what exactly i was asking is how to send a value from page1 to page2 with out redirect to page2. if we use query string we write as: in page1: Server.Transfer("page2.aspx?value=checked") in page2: string str= Request.QueryString("value") in the above senario page2 is displaying on the browser which should not occur. so kindly you please send me some suggestions for that thanks dittu

                      A Offline
                      A Offline
                      Anurag Gandhi
                      wrote on last edited by
                      #10

                      You mean to say that you wish to execute Page2.aspx but don't want to display on the browser. Use Server.Execute for the same. In Page1:

                      Server.Execute(“page2.aspx?value=checked”);

                      Page2 seems fine. Hope this will help.

                      Anurag Gandhi.
                      http://www.gandhisoft.com
                      Life is a computer program and every one is the programmer of his own life.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups