快速提问。有没有办法在HTML属性中使用asp:Literal文本?
实施例
<asp:Literal Text="hidden" runat="server" ID="ClassTag"></asp:Literal>
<tr class='<%= ClassTag %>' run="server" > </tr>
我正在为上下文处理转发器表行折叠问题(asp:repeater collapsing table rows)的整体解决方案,这可能是我坚持的最后一件事。
请告诉我。谢谢!
答案 0 :(得分:2)
不是真的,但你只是想从代码中设置TR上的类吗?
在这种情况下,请编写以下ASP.NET:
@Override
protected void onPostExecute(Object result) {
// dismiss the dialog once product deleted
//Toast.makeText(getApplicationContext(),result,Toast.LENGTH_LONG).show();
try {
if (result != null) {
// display result.toString() only after checking is null or not
Log.d("TAG", result.toString());
if (result.toString().length() > 0) {
JSONObject json = new JSONObject(result.toString());
if (json != null && json.getString("message") != null) {
String message = json.getString("message");
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
} else {
// TOAST for empty result or capture this for future analysis
}
} else {
// TOAST for empty result or capture this for future analysis
}
} else {
Toast.makeText(getApplicationContext(), "Unable to retrieve any data from server", Toast.LENGTH_LONG).show();
}
} catch (JSONException e) {
// Have a toast to display user friendly message
// Capture this in files or DB so can be used to report on user consent
Log.d("TAG", "Exception Details: " + e.toString());
e.printStackTrace();
} catch (Exception e) {
// Have a toast to display user friendly message
// Capture this in files or DB so can be used to report on user consent
Log.d("TAG", "Exception Details: " + e.toString());
e.printStackTrace();
}
}
在代码隐藏中,通过Attributes集合设置类:
<tr runat="server" ID="CustomRow">