Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi..

I m Using ASP.net 2005.

i want to Bind Grid View Using Query String.

suppose i sent mail of URL. when user clicks on that URL based on that link i want to bind Grindview and Display on Screen

Thnaks & Regards,
Nikunj Chheda.
Posted

PLEASE stop asking variations of the same question over and over. This question can't be answered. What you bind your grid to currently is up to you. We don't know what it is. We also don't know why what you bind to can vary. So, we can't answer you. Ideally, when your page varies what it shows, such as the page within the grid, or a filter, it would do that by redirecting to itself with instructions on the query string. Then your URL will work.
 
Share this answer
 
Comments
nikunjnik 12-Jul-11 5:25am    
Hello, I m not asking same Question Again and again..

i think u r not getting my Question what i mtrying to explaing u ..
Christian Graus 12-Jul-11 5:36am    
You are making small changes to the same question. I see what you want to do, but you should edit the one post, instead of making small changes, all of which come down to the same thing. Your question can't be answered. The only answer we can give is, put the data you need on the query string.
When you send the email to user send him a link with a querystring and set the userID in the querystring parameter. When the user receive that mail he will click the link and redirect to the page which you set in link. In that page you have to get the useId from querystring and on the basis of that value you can fetch the relevent data from your database and bind the gridview.
 
Share this answer
 
v2
Comments
nikunjnik 12-Jul-11 5:29am    
Thanks for the answer..

i got the Idea.. but i m new in >net so can u help me for the code or any references
Christian Graus 12-Jul-11 5:37am    
If you're this new, it's clear that the task is beyond you. If you're being paid for this code, you are a thief. If you're doing homework, you need to talk to your teacher. If you're doing it to learn, then learn by doing something you're capable of. Work up to this. Learn to use google. The query string is a simple, widely documented concept.
Sachin__Sharma 12-Jul-11 5:38am    
try this
http://www.systemnetmail.com/faq/3.1.1.aspx
In body section you have to set 
<a href="http://www.yoursite.com/yourpage.aspx?uid=abc101"></a>

I am talking about email body where you have to set this.
When user click this link this link will take to user to yourpage.aspx with userid and you have to get the valude from query strig.

   Dim getval As String = Request.QueryString("uid").ToString()

now you do like 

Dim cmd as new sqlcommand("Select * from User where userid='"& getval &"'",conn)

       If con.State = ConnectionState.Closed Then
            con.Open()
        End If
        Dim dr As SqlDataReader
          dr = cmd.ExecuteReader
        
            GridView1.DataSource = dr
            GridView1.DataBind()
     
      

        con.Close()
 
Share this answer
 
v3
Comments
Christian Graus 12-Jul-11 6:35am    
What is that ?
Sachin__Sharma 12-Jul-11 6:36am    
what?
nikunjnik 13-Jul-11 3:30am    
HI.. Sachin i got the idea..

can u tell me this code i have to write on pageload or othr event...?

if i add this into pageload then every time it will bind the data..

plz reply ..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900