|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Selecting a value from a Gridview Controla query string. I have a select button on the gridview and once the user hits the select button i want to capture the the userid. Here's some example code and you can see where i'm trying to do this in on the line that starts with Response.Redirect: protected void SearchUserMenu_MenuItemClick(object sender, MenuEventArgs e) { if (GridView1.SelectedIndex > -1) { switch (e.Item.Text) { case "Security User": Response.Redirect("~/SecurityUser.aspx?userID=" + GridView1.SelectedRow.DataItem); break; case "WFM User Group/Location": break; case "Maintain User": break; case "Add User": break; } } } any suggestions would be great. Thanks Try this:
GridViewRow row = GridView1.SelectedRow; string yourDataItem = row.Cells[1].Text; hal wrote: Show quoteHide quote > I'm trying to get a value from a gridview control and put that value in > a query string. I have a select button on the gridview and once the > user hits the select button i want to capture the the userid. Here's > some example code and you can see where i'm trying to do this in on the > line that starts with Response.Redirect: > > protected void SearchUserMenu_MenuItemClick(object sender, > MenuEventArgs e) > { > if (GridView1.SelectedIndex > -1) > { > switch (e.Item.Text) > { > case "Security User": > Response.Redirect("~/SecurityUser.aspx?userID=" + > GridView1.SelectedRow.DataItem); > break; > case "WFM User Group/Location": > break; > case "Maintain User": > break; > case "Add User": > break; > } > } > } > > > any suggestions would be great. > Thanks
Save Child GridView only when parent GridView Saved
apply an ItemTemplate dinamically fill ObjectDatasource on request HyoerLink - need 2 params Select text in asp:textbox Auto postback in dropdownlist Failed to load viewstate. Getting error BC30560 with CR 11 Release 2 WebParts - can you transfer one users choice to all users? Any way to include an HTML form with server-side controls? |
|||||||||||||||||||||||