Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
at the begining im sorry about my english
i have this code in cs:
XML
foreach (System.Data.DataRow oDataRow in oDataTable.Rows)
            {

                litContent.Text = litContent.Text +
            string.Format("<div>"
            + "<div class=" + "\"top\"" + ">"
            + " <div class=\"comm_info\">"
            + "<div class=\"comm_info_Title\">{0}</div>"
            + "<div class=\"LikeDislike\">"
            + "<div class=\"Count\">24</div>"
            + "<div class=\"imgbutton\">"
            + "<asp:imagebutton src=\"../Image/Like.png\" runat=\"server\" id=\"lnkLike\" onclick=\"lnkLike_OnClick\"/></div>"
            + "<div class=\"imgbutton\">"
            + "<asp:linkbutton id=\"lnkDislike\" runat=\"server\" cssclass=\"DislikeButton\" ></asp:linkbutton></div>"
            + "<div class=\"Count\">34</div></div>"
            + "<div class=\"fr_imgR\"></div>"
            + "<div class=\"comm_info_content\">"
            + "<div class=\"comm_info_name\">{0}</div>"
            + "<span class=\"comm_sep\">|</span>"
            + "<div class=\"comm_info_date\">{1}</div>"
            + "</div><div class=\"fr_imgL\"></div></div>"
            + "</p></div>"
            + "<div class=" + "\"mid\"" + ">"
            + "<div class=" + "\"in\"" + ">"
            + "<div class=" + "\"body\"" + " style=" + "\"margin-bottom: 5px;\"" + ">"
            + "{2}"
            + "</div>"
            + "</div>"
            + "</div>"
            + "<div class=" + "\"bottom\"" + ">"
            + "</div>"
        + "</div>", oDataRow["Title"].ToString(), System.Convert.ToDateTime(oDataRow["updatetime"]), oDataRow["Body"].ToString());



            }

but in the run time <asp:imagebutton and <asp:linkbutton dosent work and it isnt seen and i cant click on it tu run click function
plz help me.
tnx
Posted

1 solution

It cannot work in principle. This is not how ASP.NET works. Even if you generated pure HTML code, it would be really bad. I explained it in my recent solution: convert this in xml string[^].

Just kill this idea. Do you want ASP.NET at all? if so, learn how to use it here: http://www.asp.net/get-started[^].

—SA
 
Share this answer
 
Comments
zinajoonjooni 16-Nov-11 3:33am    
thanks for your reply can you help me to correct this code?im beginner in asp.net,if i replace <asp:imagebutton with<img runat="server" önclick="??" ,how i can use onclick event can you write a short example for me with this tag?is it correct?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900