1

我正在尝试从后面的代码中为 div 分配一个 innerhtml 值。这是我得到的:

private void ModalBody()
{
    LoadTemplateOverride();
    divModalBody.InnerHtml = 
}
private void LoadTemplateOverride()
{
    string templateURL = String.Format("{0}/leadgen/eodemails/templatecontroller.aspx?eodid={1}", site.Get("InternalApiUrl"), Email.ID);
    HttpWebRequest request = HttpWebRequest.Create(templateURL) as HttpWebRequest;

    HttpWebResponse response = request.GetResponse() as HttpWebResponse;

    tbSubject.Text = response.Headers["EmailSubject"];
    tbBody.Text = (new StreamReader(response.GetResponseStream())).ReadToEnd();
}
4

1 回答 1

0

也许你可以使用Literal控制。它将您放在其Text属性上的任何内容输出到呈现的 HTML。

标记:

<asp:Literal ID="Literal1" runat="server"></asp:Literal>

后面的代码:

Literal1.Text = "<div>Some <strong>nice</strong> HTML</div>";
于 2013-06-06T21:12:58.157 回答