Hi,
You have to to declare it on the aspx side at all. Just do it all in the
code will be much more easier and convenient!
HTHs...
R. Thomas

"Boo Khan Ming" wrote:
> Hi,
>
> Depends on number of records in database, each record should create a unique
> datagrid - I use AccessDataSourceControl of Web Matrix.
>
> My questions is that:
> - The "id" tag of server control, can be put variable name? (This is a way
> for me to create dynamic datagrid during runtime)
>
> E.g.
>
> <%for i=0 to array.count-1%>
> <asp:datagrid id=i runat="server"/>
> <%next%>
>
> Is this allowed?
>
> Or,
>
> E.g.
>
> <asp:placeholder id="PlaceHolder1" runat="server"/>
>
> <% for i=0 to array.count-1%>
> <%
> dim repgrid as new datagrid
> a.selectcommand="...........'" & i.tostring & "'"
> datagrid.id=i
> datagrid.datasource=a
> PlaceHolder1.controls.add(datagrid)
> databind()
> %>
> <%next%>
>
> But this one doesn't work either, because all datagrids appear similar in
> their data contents.
>
> And, for this one too, the controls created in pyramid order.
> 1st record
> - 0 datagrid
> 2nd record
> - 1 datagrid
> 3rd record
> - 2 datagrids
> ...
> ...
>
> Can you recommend a good way to dynamically create datagrid?
> Or, AccessDataSourceControl, other than using datagrid.DataSource to acquire
> the data, can I take the result from data source directly?
>
> Khan Ming
>
>
>