Note that there are some explanatory texts on larger screens.

plurals
  1. POinput string is not in correct format for retrieveing gridview value
    text
    copied!<p>In my grid view I want that when user click on activate then it navigate to activate.aspx page. And I want to retrieve three values from previous page to activate.aspx page. My code is:</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { if (this.Page.PreviousPage != null) { int rowIndex = int.Parse(Request.QueryString["RowIndex"]); GridView GridView1 = (GridView)this.Page.PreviousPage.FindControl("GridView1"); GridViewRow row = GridView1.Rows[rowIndex]; Label1.Text = row.Cells[3].Text; Label2.Text = row.Cells[2].Text; Label3.Text = row.Cells[2].Text; SqlDataAdapter da = new SqlDataAdapter("insert into login values('" + Label1.Text + "','" + Label2.Text + "','" + Label3.Text + "')",con); DataSet ds = new DataSet(); da.Fill(ds); } } protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Redirect") { String email = "lblemail.Text"; String mob = "lblmobno.Text"; Server.Transfer("activate.aspx?RowIndex=" + email +mob, true); } } </code></pre> <p>Aspx markup</p> <pre><code> &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" onrowcommand="GridView1_RowCommand"&gt; &lt;Columns&gt; &lt;asp:TemplateField HeaderStyle-Font-Bold="true" HeaderStyle-Font-Size="Larger" HeaderText="Activate/Delete" ItemStyle-Width="150px"&gt; &lt;ItemTemplate&gt; &lt;asp:LinkButton ID="linkbutton1" runat="server" Text="Activate" CommandName="Redirect" CommandArgument='&lt;%# DataBinder.Eval(Container, "RowIndex") %&gt;'&gt;&lt;/asp:LinkButton&gt; &lt;span onclick="return confirm('Are You sure want to Delete?')"&gt; &lt;asp:LinkButton ID="linkbutton2" runat="server" Text="Delete" CommandName="Delete"&gt;&lt;/asp:LinkButton&gt; &lt;/span&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>I'm getting error that input string is not in correct format for the following lines:</p> <pre><code> int rowIndex = int.Parse(Request.QueryString["RowIndex"]); </code></pre> <p>pls help me.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload