Friday, December 21, 2012

NULL In GridView EVAL Calling ServerSide Method In ItemTemplate


 
Default.aspx:

<asp:GridView runat="server" ID="test">
<Columns>
<asp:TemplateField HeaderText="view">
<ItemTemplate>
<img  alt="view" onclick="window.open(slabviewlog.aspx?ID='<%#Eval("ID") %>'&name='<%#Eval("Name") %>')"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>


Default.aspx.cs:

protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("ID");
        dt.Columns.Add("Name");
        DataRow dr = dt.NewRow();
        dr["ID"] = "1";
        dr["Name"] = "sanjay";
        dt.Rows.Add(dr);


        test.DataSource = dt;
        test.DataBind();
    }



If you are searching life partner. your searching end with kpmarriage.com. now kpmarriage.com offer free matrimonial website which offer free message, free chat, free view contact information. so register here : kpmarriage.com- Free matrimonial website

Related Posts:

  • SQL RIGHT JOIN SQL RIGHT JOIN Keyword The RIGHT JOIN keyword returns all the rows from the right table (table_name2), even if there are no matches in the left tab… Read More
  • SQL FULL JOIN SQL FULL JOIN Keyword The FULL JOIN keyword return rows when there is a match in one of the tables. SQL FULL JOIN Syntax SELECT column_name(s) FR… Read More
  • Anonymous Methods in asp.net In versions of C# previous to 2.0, the only way to declare a delegate was to use named methods. C# 2.0 introduces anonymous methods c#. Creating anon… Read More
  • sample code for call webservice using ajax in asp.net Here we call webservice using ajax update panal and javascript . We see also how an ASP.NET AJAX-enabled web service generates the JavaScript needed … Read More
  • SQL INNER JOIN Keyword SQL INNER JOIN Keyword The INNER JOIN keyword returns rows when there is at least one match in both tables. SQL INNER JOIN Syntax SELECT column_n… Read More

0 comments:

Post a Comment