参考:http://blog.csdn.net/ligenyingsr/article/details/6042287
已经添加控件的div中添加标签,直接添加不行,必须得转换为string才可。
//添加换行 System.Text.StringBuilder strb = new System.Text.StringBuilder(); System.IO.StringWriter sw = new System.IO.StringWriter(strb); System.Web.UI.HtmlTextWriter htw = new HtmlTextWriter(sw); divImage.RenderControl(htw); string str = strb.ToString();//str即为所需值。 divImage.InnerHtml = str; divImage.InnerHtml += "<br/>";