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. Previous Page Problem

Previous Page Problem

Scheduled Pinned Locked Moved ASP.NET
helpquestion
10 Posts 3 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.
  • W Offline
    W Offline
    waheed awan
    wrote on last edited by
    #1

    i am using this to redirect GridView2.DataSource = dummy_rules; GridView2.DataBind(); foreach (GridViewRow row in GridView2.Rows) ((LinkButton)row.Controls[0].Controls[0]).Attributes.Add("onclick", "window.showModalDialog('CreateRule.aspx?new=editM',null, 'status:no;dialogWidth:555px;dialogHeight:425px;di alogHide:true;help:no;scroll:no')"); the dialog box appears but i need the gridview there.........but when i use Prevouspage it throws exception Object reference not set to an instance of an object i have added the directive ]]>;

    N 1 Reply Last reply
    0
    • W waheed awan

      i am using this to redirect GridView2.DataSource = dummy_rules; GridView2.DataBind(); foreach (GridViewRow row in GridView2.Rows) ((LinkButton)row.Controls[0].Controls[0]).Attributes.Add("onclick", "window.showModalDialog('CreateRule.aspx?new=editM',null, 'status:no;dialogWidth:555px;dialogHeight:425px;di alogHide:true;help:no;scroll:no')"); the dialog box appears but i need the gridview there.........but when i use Prevouspage it throws exception Object reference not set to an instance of an object i have added the directive ]]>;

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      What do you mean, "the dialog box appears but i need the gridview there"? You want a gridview in the createrules.aspx page that appears in your modalDialog? What are you trying to accomplish with the PreviousPageType, and why is it in a CDATA ?


      only two letters away from being an asset

      W 1 Reply Last reply
      0
      • N Not Active

        What do you mean, "the dialog box appears but i need the gridview there"? You want a gridview in the createrules.aspx page that appears in your modalDialog? What are you trying to accomplish with the PreviousPageType, and why is it in a CDATA ?


        only two letters away from being an asset

        W Offline
        W Offline
        waheed awan
        wrote on last edited by
        #3

        i have added %@ PreviousPageType VirtualPath ="~/StartPage.aspx" % in my dialog page i want to access Gridview of StartPage.aspx which is the previous page but in the dialog page the previous page is null Thanks

        N 1 Reply Last reply
        0
        • W waheed awan

          i have added %@ PreviousPageType VirtualPath ="~/StartPage.aspx" % in my dialog page i want to access Gridview of StartPage.aspx which is the previous page but in the dialog page the previous page is null Thanks

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Do you need to access the control or the data in the control? PreviousPage is of course going to be null because you are opening the page via a JavaScript function. There is no Postback occurring for ASP.NET to set the value.


          only two letters away from being an asset

          W 1 Reply Last reply
          0
          • N Not Active

            Do you need to access the control or the data in the control? PreviousPage is of course going to be null because you are opening the page via a JavaScript function. There is no Postback occurring for ASP.NET to set the value.


            only two letters away from being an asset

            W Offline
            W Offline
            waheed awan
            wrote on last edited by
            #5

            i want to access the data of the gridview controll.

            N 1 Reply Last reply
            0
            • W waheed awan

              i want to access the data of the gridview controll.

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              Then call the same method you use to populate the grid on the first page. :rolleyes: :rolleyes:


              only two letters away from being an asset

              W 1 Reply Last reply
              0
              • N Not Active

                Then call the same method you use to populate the grid on the first page. :rolleyes: :rolleyes:


                only two letters away from being an asset

                W Offline
                W Offline
                waheed awan
                wrote on last edited by
                #7

                i want to get column2 value of the selected row on startPage.aspx

                N 1 Reply Last reply
                0
                • W waheed awan

                  i want to get column2 value of the selected row on startPage.aspx

                  N Offline
                  N Offline
                  Not Active
                  wrote on last edited by
                  #8

                  So pass the id of the row as a querystring to the page you are trying to open. Then get the data and access that row. It really isn't as difficult as you are trying to make it.


                  only two letters away from being an asset

                  W 1 Reply Last reply
                  0
                  • N Not Active

                    So pass the id of the row as a querystring to the page you are trying to open. Then get the data and access that row. It really isn't as difficult as you are trying to make it.


                    only two letters away from being an asset

                    W Offline
                    W Offline
                    waheed awan
                    wrote on last edited by
                    #9

                    thanks but the actual problem is this i have a number of controls not only the gridview...... i thought there may be a way to access values of controls instead of passing values of all the controls in querystring

                    L 1 Reply Last reply
                    0
                    • W waheed awan

                      thanks but the actual problem is this i have a number of controls not only the gridview...... i thought there may be a way to access values of controls instead of passing values of all the controls in querystring

                      L Offline
                      L Offline
                      levonh2003
                      wrote on last edited by
                      #10

                      PreviousPage property of the page is set only if it is requested as a result of cross page post-back. In your case you are redirecting from the other page using modal dialog or smth like that. To have a cross page post back you can set PostBackUrl property of your LinkButton to the second page instead of setting onclick handler as an attribute. However in this case you won't have the modal dialog.

                      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