I want to work on nested datalist I have just tried what is wrong please
tell me.

the code is here..............

<asp:DataList ID="DL_blog" runat="server"
ondatabinding="DL_blog_DataBinding">
                        <ItemTemplate>
                            <table cellpadding="3" cellspacing="3"
class="style1">
                                <tr>
                                    <td align="center"
style="background-image: url('images/ImageBox.png')"
                                        colspan="2">
                                        <asp:Image ID="img_uploadImage"
ImageUrl='<%# "CreateBlogImage.aspx?id=" + Eval("blog_id") %>'
runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center"
style="background-image: url('images/VideoPost.png')"
                                        colspan="2">
                                        <asp:Literal ID="lit_video"
Text='<%# Eval("vedio_link") %>' runat="server"></asp:Literal>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="background-image:
url('images/PostBox.png')" colspan="2">
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <asp:LinkButton ID="lnkb_Link"
Text='<%# Eval("link") %>' CommandArgument='<%# Eval("blog_id") %>'
runat="server"></asp:LinkButton>
                                    </td>
                                </tr>

                                <tr>
                                    <td>
                                        <asp:LinkButton ID="lnkb_comments"
runat="server">Comment</asp:LinkButton>
                                    </td>
                                    <td> <asp:SqlDataSource
ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
                                        <asp:DataList ID="DL_comments"
runat="server"

ondatabinding="DL_comments_DataBinding">
                                            <EditItemTemplate>
                                                <table cellpadding="3"
cellspacing="3" class="style1">
                                                    <tr>
                                                        <td>
                                                            <asp:LinkButton
ID="lnkb_submit" runat="server">Submit</asp:LinkButton>
                                                        </td>
                                                        <td rowspan="2">
                                                            <asp:TextBox
ID="txt_comment" runat="server" Rows="5" Text='<%# Eval("link") %>'
TextMode="MultiLine"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:LinkButton
ID="lnkb_cancel" runat="server" CommandName="cancel">Cancel</asp:LinkButton>
                                                        </td>

                                                    </tr>
                                                </table>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <table cellpadding="2"
class="style1">
                                                    <tr>
                                                        <td>'<%#
Eval("comment") %>'
                                                            </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </asp:DataList>



code on .cs page is here...................
protected void Page_Load(object sender, EventArgs e)
    {
        adpt = new SqlDataAdapter("select * from tbl_blog", cn);
        adpt.Fill(ds, "blog");
        DL_blog.DataSource = ds.Tables["blog"];
        DL_blog.DataBind();
    }
protected void DL_comments_DataBinding(object sender, EventArgs e)
    {
    }
    protected void DL_blog_DataBinding(object sender, EventArgs e)
    {
        SqlDataSource sqlds;
        sqlds =
(SqlDataSource)DL_blog.Items[int.Parse(DL_blog.DataKeyField)].FindControl("SqlDataSource1");
        sqlds.SelectCommand = "select * from tbl_comment where comment_id="
+ DL_blog.DataKeyField;
        DataList dl1;
        dl1 =
(DataList)DL_blog.Items[int.Parse(DL_blog.DataKeyField)].FindControl("DL_comments");
        dl1.DataSource = sqlds;
        dl1.DataBind();
    }


thanks in advance

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to dotnetdevelopment@googlegroups.com
To unsubscribe from this group, send email to
dotnetdevelopment+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to