Q: ASP.NET cant access datatable created in Page load from inline coding In my Page_Load event of codebehind file, I am loading data in to a datatable.In my .aspx page I am having some inline coding,I want to display some data from this datatable.But when i am running the program,It is showing an error like "Error  64  Use of unassigned local variable 'dtblChild' "
dtblChild is my DataTable Object
Is Page_Load in codebehind executes after loading the form elements ?

A: Inline Code executes during the Render stage.
in the lifecycle of a page, Render happens much later than Load

A: Yes, the page load executes after all of the server controls have been loaded into memory, but you have to ensure that the datatable is repopulated on each refresh if you're going to use it.
I think your question indicates some deeper problems with the way you're binding to the page.
Can you post some code?

A: Try using a repeater control or datagridview rather than <% %> bee stings for this.  Too much inline-code doesn't mix very well with code behind files: you can get unexpected results.   It can work if you really know what you're doing, but you have to be careful and I wouldn't recommend it for anyone new to ASP.Net.
I also recommend that you take some time and become very familiar with the ASP.Net Page Lifecycle.

A: This is my inline coding
</tr>
 <%
      foreach (DataRow dr in dtblChild.Rows)
      {
    %>
    <tr><td>Thissss</td></tr>
         <%
  }

%>
in my code behind Page_Load ,i am populating Data to a DataTable object (dtblChild)

A: The more "ASP.Net-ish" way to do this is like this:
<asp:Repeater ID="MyRepeater" runat="server" DataSource="dtblChild">
    <ItemTemplate>
        <tr><td>Thisss</td></tr>
    </ItemTemplate>
</asp:Repeater>

You probably also need to declare an ObjectDatasource to wrap your datatable to make it compatible with the repeater.

A: Bind your dtblChild to a repeater (or DataGrid) as suggested above. It will be easier to maintain. Then populate the DataTable in a separate function and bind it to the repeater. Call that function in Page_Load when you need to.
<table>
<asp:Repeater ID="rptSearchResults" runat="server">
    <ItemTemplate>
        <tr>
            <td><%#DataBinder.Eval(Container.DataItem, "ColumnName") %></td>
        </tr>
    </ItemTemplate>
</asp:Repeater>
</table>

function LoadData()
{
rptSearchResults.DataSource = dtblChild;
rptSearchResults.DataBind();
}
