如果spnCity
的值为“ABC”,则将id1
设置为类(tableHeading
),否则将id1
设置为类(tableHeading2
)
如何在Web处理程序中从代码隐藏中访问spnCity
范围,或者如果不可能,我如何使用JQuery访问它。
我的偏好是真正使用C#代码隐藏,因为我有一个执行某些复杂操作的函数。
DateTime now = DateTime.Now;
//DateTime test = DateTime.Now.AddHours(8);
string time = now.ToString("T");
static public bool IsTimeOfDayBetween(DateTime time, TimeSpan startTime, TimeSpan endTime)
{
if (endTime == startTime)
{
return true;
}
else if (endTime < startTime)
{
return time.TimeOfDay <= endTime ||
time.TimeOfDay >= startTime;
}
else
{
return time.TimeOfDay >= startTime &&
time.TimeOfDay <= endTime;
}
}
答案 0 :(得分:1)
由于您问if that is not possible, how do I access it using JQuery.
,我正在编写使用jquery
访问该问题的答案。以下是jQuery
代码,用于访问该跨度值。
$("#id1 h4 span").text().trim()