Adding data dynamically to a asp literal control inside a grid view
<p>I'm tring to add data to a literal which place inside a gridview. Currently code look like this</p>

<pre><code>protected void GvListingRowDataBound(object sender, GridViewRowEventArgs e)
{
       var qurey = DisplayAllData();
       Literal info = (Literal)e.Row.FindControl("ltritemInfo");
       if(qurey != null)
       {
                foreach (var listing in qurey)
                {

                    var list = DisplayListById(listing.id);
                    info.Text = "&lt;h3&gt;" + list.title + "&lt;/h3&gt;";
                    info.Text += "&lt;h4&gt;" + list.description + "&lt;/h4&gt;";

                  }
        }
}
</code></pre>

<p>This will generate an error "Object reference not set to an instance of an object."</p>

<p>if anyone have idea about this it will be great help</p>

<p>Thanks</p>
