Question : Bind the value

Hi

I am using link button in the gridview and I have given the property PostBackURL

PostBackUrl = "~/ApplicationAddEdit.aspx?ApplicationID=<%#Bind('ApplicationID') %>"

But I think there is something missing because on the applicationAddEdit page I am getting query string as <%#Bind('ApplicationID') %> instead of binding value

Am I missing something

Answer : Bind the value


Hi Karan Gupta,

add a rowdatabound event for the gridview like

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton obj = (LinkButton)e.Row.FindControl("LinkButton1");
            obj.PostBackUrl = "~/default.aspx?ApplicationID="+obj.Text;
        }
    }

the Linkbutton in the gridView will look like

 
                           
                       
Random Solutions  
 
programming4us programming4us