点击button_click后,需要执行一段代码,查找到相应的数据后,如何根据查找的结果弹出选择对话框,如果确认,执行一段代码,如果取消,则不执行后续代码,请教大侠,在线等待……
解决方案 »
- 有updatepanel时,$(function() { 中bind按钮事件,回发时重复绑定
- 我想问一下有关网站数据同步,用户登录状态同步的问题
- 怎么用.net读取一个.txt的文本文件,并将读出的内容存入Oracle9I数据库中~!急!在线等!
- 初学.net,关于Table 的 id的声明.
- 关于未将对象引用设置到对象的实例,给30分,急呀!
- 向大家提问,在。net中,将两种数据库数据进行sql --“select in ”语句的直接比对,能实现否?
- |M| 在线等马上给分:当面别有多个按钮的时候如何给控件添加验证控件 谢谢
- 麻烦高手们来看看这段代码问题出在哪里:
- .NET配置问题
- 怎么向数据库中插入图片?
- ASP.net 关于SQL2000数据库存取二进制文件
- 100分求数据库留痕思路或方法
不管怎么样都先转到过渡页面,在自定义的WEB窗口中做处理
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> new document </title>
<script language="javascript">
<!--
function step1() {
txt.value = "1"; // 需要的话换成ajax方法
if(confirm("继续加?")) {
txt.value = "2"; // 这里也一样
}
}
//-->
</script>
</head> <body>
<input type="text" id="txt" name="txt">
<input type="button" name="" value="example" onclick="step1();">
</body>
</html>
IF{}else{}
你有在这一直等的时间,就能把atlas、和callback看会了,如果你再等两天,就连ajax.net都能看会。
谢谢您了,不过教育我的话劳烦您就不要说了,该如何做我心里比你清楚,呵呵,不过我自己的帖子,我还是会关注的,不光是为我,也为关注论坛的其他人。
如果不使用Ajax的话,处理起来应该很痛苦...
声明一下,你可能误会了,没这个意思,只是想告诉你ajax很简单
/// 提示用户选择是OR否,然后转向不同页面
/// </summary>
/// <param name="pMessage"></param>
/// <param name="pYesNavigateTo"></param>
/// <param name="pNoNavigateTo"></param>
/// <param name="pKey"></param>
/// <param name="pPage"></param>
public static void RegisterConfirmScript(string pMessage, string pYesNavigateTo, string pNoNavigateTo, string pKey, Page pPage)
{
string script = "<script language='javascript' defer>if(confirm('" + pMessage + "'))\r\n window.navigate('" + pYesNavigateTo + "');\r\n else\r\n window.navigate('" + pNoNavigateTo + "')</script>";
pPage.ClientScript.RegisterStartupScript(pPage.GetType(), pPage.UniqueID + pKey, script, false);
}
{
Button1.OnClientClick = ("return confirm('..信息')");
}
我已经在vs2003中安装ajax插件了,可是不知道该如何调用,请给予指导或者给予一段代码参考一下
/// <summary>
/// 得到公告的内容
/// </summary>
/// <returns>公告的内容</returns>
[Ajax.AjaxMethod]
public string GetNoticeContent()
{
modernedubs.Other other = new modernedubs.Other();
return other.GetNoticeContent();
}
#endregion #region 更新公告的内容
/// <summary>
/// 更新公告的内容
/// </summary>
/// <param name="content"> 公告的内容 </param>
/// <returns> 影响的行数 </returns>
[Ajax.AjaxMethod]
public int SetNoticeContent(string content)
{
if(content.Length <= 500)
{
modernedubs.Other other = new modernedubs.Other();
return other.SetNoticeContent(content);
}
else
{
return 0;
}
}
#endregion然后在页面js里调用
function PageLoad()
{
var content = document.getElementById("txtContent");
content.value = notice.GetNoticeContent().value;
}function SubContent()
{
var content = document.getElementById("txtContent");
if(content.value.length < 500)
{
if(notice.SetNoticeContent(content.value).value == 1)
{
alert('Update Succeed...!');
}
else
{
alert('Update Lost...!');
}
}
else
{
alert('The Content is too Long...!');
}
}
相关的交互就用触发js就可以了。这个和你要的东西不太一样,不过是可以用的,你参考下