Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7807065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:44:09+00:00 2026-06-02T02:44:09+00:00

I wasn’t able to get an answer to this and i need it badly!

  • 0

I wasn’t able to get an answer to this and i need it badly!

The problem really is that i do can trough the selects on the gridview get the data trough the id, but then i use the search option i implemented on the page and the gridview shows the ones it gets that match the result but if i press select it will redirect to the page with the wrong id, isntead of getting the id of the one i selected it gets the id of the field that was on the 1st position of the cell.

Here is the code:

protected void Page_Load(object sender, EventArgs e)
{

    TeamGest.DBLayer.DBLTeams dbl = new TeamGest.DBLayer.DBLTeams();
    GridView1.DataSource = dbl.List();
    GridView1.DataBind();

    TeamGest.DBLayer.DBLPlayers dbl1 = new TeamGest.DBLayer.DBLPlayers();
    GridView2.DataSource = dbl1.List();
    GridView2.DataBind();
}

protected void MyMenu_MenuItemClick(object sender, MenuEventArgs e)
{
    {
        MyMultiView.ActiveViewIndex = Int32.Parse(e.Item.Value);
        int i;
        for (i = 0; i <= MyMenu.Items.Count - 1; i++)
        {
            if (i == Convert.ToInt32(e.Item.Value))
            {
                MyMenu.Items[i].Text = MyMenu.Items[i].Text;
            }
            else
            {
                MyMenu.Items[i].Text = MyMenu.Items[i].Text;
            }
        }
    }
}

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
    GridViewRow row = GridView1.SelectedRow;

    Response.Redirect("DetalhesClube.aspx?Id="+row.Cells[0].Text);

}
protected void Button1_Click1(object sender, EventArgs e)
{
    string searchStringTeam = TextBox1.Text;
    GetTeamResults(searchStringTeam);
}
protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
{
    GridViewRow row = GridView2.SelectedRow;
    Response.Redirect("DetalhesJogador.aspx?Id=" + row.Cells[0].Text);
}

protected void Button2_Click(object sender, EventArgs e)
{
    string searchStringPlayer = TextBox2.Text;
    GetPlayerResults(searchStringPlayer);    
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:44:10+00:00Added an answer on June 2, 2026 at 2:44 am

    Instead of appending row.Cells[0].Text in query string, Use a label control in itemtemplate of the grid view, use eval in script side to populate the control.once the grid view gets populated the label will also get populated with the value given in the eval script.

    Now use findcontrol c# function to get the value of the label inside the grid and append this value in query string.

    refer : How to find control in TemplateField of GridView?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wasn't able to find out (googling, reading mysql reference manual) how to get
I wasn't able to find documentation for this. It looks like the R source
I wasn't able to find an overview of the types which can be hinted
I wasn't the one who coded this line of code, and I can't gt
Solved: Unfortunately I wasn't able to solve the problem but I started over and
I wasn't even sure how to title this right. I have a page that
Edit - Wasn't getting a response so let me ask this. Can I do
I wasn't sure how to word this exactly. But I have a model that
Wasn't really sure how to search for this... I have a the following which
I wasn't really sure how to phrase the name of this thread, so if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.