confrim取值问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 14:45:24
我想在CS页面中取到confrim的结果, 为TRUE 或是false;
代码如下:bool flag = false;
bool aa = true;
ClientScript.RegisterStartupScript(GetType(), new Guid().ToString(), "<script language='javascript'>functionName();)</script>");
HttpContext.Current.Response.Write("<script>if(confirm('此选项有子级,确定要连子级一起删除吗?')){'"+flag+"'='"+aa+"';}</script>");
if (flag)
{
/***************
* 这里面就是执行删除的语句;
* *******************/
Response.Write("<script>alert('成功')</script>");
}

那样只能用ajax了

=================
代码如下:

function GetXmlHttpObject()
{
//创建XMLHttpRequest对象来发送和接收HTTP请求与响应
xmlHttpObj = null;
try
{
// FireFox Opera 8.0+ Safari
xmlHttpObj = new XMLHttpRequest();
if(xmlHttpObj.overrideMimeType)
{
xmlHttpObj.overrideMimeType('text/xml');
}
}
catch(e)
{
// IE
try
{
xmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttpObj;
}

function StateChanged()
{
if(___xmlHttp.readyState == 4)
{
if(___xmlHttp.status == 200)
{
}
else