CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2007
    Posts
    116

    Angry Response.Reirect()...

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
    if (e.Row.Cells.Count > 0)
    {
    strGridValue = e.Row.Cells[0].Text;
    if (strGridValue != "ID")
    {
    e.Row.Attributes.Add("ondblclick", "javascript:alert('" + strGridValue + "')");
    Session.Add("Value", strGridValue);//This Line of code will work here?
    Response.Redirect("Default.aspx");//This Line of code will work here?
    }
    }
    }


    This code is not working....Please help...

  2. #2
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: Response.Reirect()...

    what do you want the code to do? from the code that you posted, it looks like you want to redirect to a different page everytime a new row is loaded into the Grid. Though that is only going to work for the first row since it will redirect with the first row so it won't load the other rows.

    Is that what you are wanting to happen?

  3. #3
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Response.Reirect()...

    Do you want it this way. When a user clicks on any row of the gridview, the user should be taken to a new page.

    IF that is the case, then my earlier link that I posted to your other thread would still work. Why are you using RowDatabound event to do this? You should look through the documentation of the GridView and associated events to understand which event would be suited for what.

  4. #4
    Join Date
    Mar 2007
    Posts
    116

    Re: Response.Reirect()...

    Yes....I want to redirect from one page to other page with GridView cell value...(When user double click it)

  5. #5
    Join Date
    Mar 2007
    Posts
    116

    Re: Response.Reirect()...

    Could you please provide me a sample code....Which can help me out...

  6. #6
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Response.Reirect()...

    Quote Originally Posted by Frank100 View Post
    Could you please provide me a sample code....Which can help me out...
    As I suggested in your other thread here, you need to go through the sample that is present on MSDN here. They have all the code that you are looking for , you just need to tweak it a bit.

    Why is it so difficult for you to go through MSDN?

  7. #7
    Join Date
    Mar 2007
    Posts
    116

    Thumbs up Re: Response.Reirect()...

    Thanks Shuja...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured