Response.Write在服务器控件属性中不起作用?

Lal*_*lit 0 .net asp.net servercontrols

我不知道为什么这不起作用.

<asp:Label ID="lblTitle1" runat="server" Text='<%= string.Format("{0} <br /> {1}","Part 1", "Part 2") %>' ></asp:Label>
Run Code Online (Sandbox Code Playgroud)

我只想将两个资源字符串组合成标签文本?

sis*_*sve 5

请改用数据绑定,Text='<%# String.Format(...) %>'并确保在代码中的某处调用DataBind().