1.HTML
<script type="text/javascript">
function showDetail(rowId,time,suc)
{
if(suc == "Y" )
{
window.open('DetailInformation.aspx?MessageID='+rowId+'&year='+year+'&month='+month+'&date='+date+'&hours='+hours+'&minutes='+minutes+'&seconds='+seconds,'','width = 800,height = 600,scrollbars=1'); } else
{
alert("There are no detail information for this action!");
}
}
</script>
................
<componentart:ClientTemplate ID="DetailTemplate">
<a href="javascript:showDetail('##DataItem.GetMember('AlertID').Value##',
'##DataItem.GetMember('ActionTime').Value.getYear()##',
'##DataItem.GetMember('ActionTime').Value.getMonth()##',
'##DataItem.GetMember('ActionTime').Value.getDate()##',
'##DataItem.GetMember('ActionTime').Value.getHours()##',
'##DataItem.GetMember('ActionTime').Value.getMinutes()##',
'##DataItem.GetMember('ActionTime').Value.getSeconds()##',
'##DataItem.GetMember('IsSuccess').Value##')">Detail</a></componentart:ClientTemplate>
................
<Columns>
<componentart:GridColumn HeadingText="Suc" AllowGrouping="False" DataField="IsSuccess"></componentart:GridColumn>
<componentart:GridColumn DataCellClientTemplateId="DetailTemplate"></componentart:GridColumn>
</Columns>
2.另一页面的 CS:
int alertMessageID = int.Parse(Request.QueryString["MessageID"]);
int year = int.Parse(Request.QueryString["year"]);
int month = int.Parse(Request.QueryString["month"])+1;
int date = int.Parse(Request.QueryString["date"]);
int hours = int.Parse(Request.QueryString["hours"]);
int minutes = int.Parse(Request.QueryString["minutes"]);
int seconds = int.Parse(Request.QueryString["seconds"]);
DateTime dt = new DateTime(year,month,date,hours,minutes,seconds);
3.procedure:
CREATE procedure getActionInfor
@alertMessageID int ,
@createTime datetime
as
select
xmldata
from
AlertTempRecord
where
alertID = @alertMessageID
--and createDateTime = @createTime
and datediff(s,createDateTime , @createTime) = 0