?
Solved

accessing gridview from a different page

Posted on 2008-10-31
5
Medium Priority
?
263 Views
Last Modified: 2013-11-26
Hi All,
I have a Gridview is page1 which has several rows in it.
I have a button in page2 which when clicked has to disable few rows in Gridview from page1.
How can this be done?

Thanks..
Rohit
0
Comment
Question by:RohitRepu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 16

Expert Comment

by:ororiole
ID: 22855451
First we need to clarify. Is a Gridview control also displayed on page 2 that displays the same data as the Gridview on page 1 (except for the disabled rows)?
0
 

Author Comment

by:RohitRepu
ID: 22858235
Hi Ororiole,

No, there is no gridview on page 2.
But i need put a condition in page 2  in a button click event
such that when page 2 is executed the rows in gridview on page1 gets disabled.

Thanks...
Rohit.
0
 
LVL 16

Accepted Solution

by:
ororiole earned 1500 total points
ID: 22863207
Server page programming is stateless. That means when you are on page two there is no Gridview control on page 1 to access.  It only exists when page 1 is running on the server.

What you need to do is create a Session variable when the button is clicked. So inside your button click eventhandler on page two do this:
Session("clicked") = True

Now in page one you can check to see if the Session variable has been set:

        If Not Session("click") Is Nothing Then
            Dim click As Boolean = CType(Session("click"), Boolean)
 
            If click = True Then
                'do something with gridview
            End If
 
        End If

Open in new window

0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question