web编程中JavaScript和C#的交互问题?(aspx.net)
有如下两问题:
1、 <body>中有如下代码,另外在页中有TextBox1控件,当confirm对话框选择true时TextBox1的text为True,选择Cancel时值为Cancel
<script type="text/javascript">
var result;
result=window.confirm("Are you sure to delete it?")
window.alert(result)
</script>
2、在page上有个Button1,现在想:当点击Button1时,弹出confirm对话框,当confirm对话框选择true时Button1的text为Success,当选择Cancel时Button1的text为Failure?请问怎样写?
谢谢
JScript code:
var DateText = document.getElementById("<%=Button1.ClientID %>").value;
if(confirm('aa?'))
{
DateText = "Success";
}
else
{
DateText = "Failure";
}
HTML code:
<asp:Button runat="server" ID="Button1" onclick="return confirm('Are you sure to delete it?')" />
if(confirm('')){
button.value="success";
}else{
button.value="failure";
}
HTML code
Code highlighting produced by Actipro CodeHighlighter (
相关问答:
在数据库中有张表,有id,name两列,id 是主键,没有设置自增属性,在程序中取出这张表放入datatable,在这个datatable中插入一条记录,当更新数据库时提示id列不能为空,请问该怎么解决?
给它一个值!!主键不能为空 ......
三个数x,y,z 比大小..
var x,y,z,t;
if (x>y)
{t=x;x=y;y=t;} //交换x,y的值
if(x>z)
{t=z;z=x;x=t;}//交换x,z的值
if(y>z)
{t=y;y=z;z=t;}//交换z,y的值
这是 ......
DataSet导出xml 批处理(循环)得怎么处理
XML文件
<A>
<B>
<C>
</C>
&nb ......
可能因为工作的原因 接触数据库这块比较少,之前都是做程序这块,数据库这块都有专门的人来做 分工都很明细 所以对数据库这一块完全不了解。前段时间 去面试了几家公司 几乎都是在数据库这块挂掉的 连个简单的SQ ......
我在form1中的某个方法让form2窗体出现
那么这个时候怎么关闭form1而不关闭form2呢?
Form2 f=new Form2();
f.Show();
this.Close();
引用
Form2 f=new Form2();
f.Show();
this.Close();
这样的话整个程 ......