0

我想以这样的格式存储内容,并能够在页面回发后检索。我可以使用隐藏字段吗?如果是这样,哪种数据类型(不是字符串?) Stringbuilder ?

    <b>Email Template:</b> UserAssignment
    <b>TO:</b> manojp.nayak@gmail.com<b>CC:</b> 
    <b>FROM:</b>admin@gmail.com <b>SUBJECT:</b>Task Assignment Project Activity  has been assigned to you.

    <b>BODY:</b> Deliverable Information :
    Test Deliverable 01 Test Issue 01   


    Project Activity  assigned by: Admin at: 2013-01-29 7:50 PM

    Automated Email Notification. Do not reply.

    Email Comments: 123test

    <b>FILES:</b> 
4

2 回答 2

1

你当然可以。你可以使用类似的东西:

<asp:HiddenField ID="HiddenField_data" runat="server" />

从事件背后的代码中,您可以在此处保存所需的值,例如:

HiddenField_data.Value = @"<b>Email Template:</b> UserAssignment
    <b>TO:</b> manojp.nayak@gmail.com<b>CC:</b> 
    <b>FROM:</b>admin@gmail.com <b>SUBJECT:</b>Task Assignment Project Activity  has been assigned to you.

    <b>BODY:</b> Deliverable Information :
    Test Deliverable 01 Test Issue 01   


    Project Activity  assigned by: Admin at: 2013-01-29 7:50 PM

    Automated Email Notification. Do not reply.

    Email Comments: 123test

    <b>FILES:</b> ";
于 2013-01-29T14:38:50.713 回答
1

您可以使用用户控件来封装您的内容

Visibility :您可以使用用户控件的 Visible 属性

持久性:您可以使用 EnableViewState 属性

链接: http: //msdn.microsoft.com/fr-fr/library/system.web.ui.usercontrol (v=vs.80).aspx

于 2013-01-29T14:38:55.170 回答