急急 asp.net 弹出窗口的问题,快来帮忙一下吧!!
Page.ClientScript.RegisterStartupScript(GetType(), "alert", " <script>alert('用户名是: '"+TextBox_name.Text+ " '密码是:'" + TextBox2_pwd.Text + "') </script>");
以上我是要弹出一个对话框的代码,弹出的对话框然后提示我用户名和密码是什么。 可是老弹不出来,请帮满看一下我的标点符号哪里写错位置了。
请帮我修改一下。
C# code:
TextBox_name.Text = "admin";
TextBox2_pwd.Text = "123";
if (!Page.ClientScript.IsStartupScriptRegistered(this.GetType(), "alert"))
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", string.Format("alert('用户名是:{0} 密码是:{1}')", TextBox_name.Text, TextBox2_pwd.Text), true);
}
用RegisterClientScriptBlock试试,因为此脚本加在网页最后面
Page.ClientScript.RegisterClientScriptBlock(GetType(), "alert", " <script>alert('用户名是: '"+TextBox_name.Text+ " '密码是:'" + TextBox2_pwd.Text + "') </script>");
楼二的 你的代码也运行不了啊!可能和我一样也是在后面的('用户名是: '"+TextBox_name.Text+ " '密码是:'" + TextBox2_pwd.Text + "')这里出问题了。
谢谢楼一。你的可以运行呢。
C# code
TextBox_name.Text=&qu
相关问答:
asp下面,当要根据不同的权限显示一些功能按钮的话会写成
<%
if 权限=1 then
%>
<input type="submit" name="Submit" value="提交" />
<%
end i ......
select top 12 * from Product where [id] not in (select top 12 [id] from Product)
这样可以分页,但是我在后面想加个条件
select top 12 * from Product where [id] not in (select top 12 [id] from Prod ......
asp.net repeater 控件怎么可以取到子控件的值,设置断点在 ItemDataBound 事件怎么没有用的
Request.Form["name"]
楼主你要在把repeater中的 一个属性设置一下才能进入itemdatabound事件
可以 ......
谁知道,最好是实例,测试过的更好,谢谢分享;
http://www.92dotnet.com/showtopic-428.aspxC# code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using Sy ......
我在写asp.net分页代码的时候遇到这样一个问题:点击下页(系统自带的数字页码)没有显示数据但是返回到第一页却可以正常显示第一页的数据.......
源代码如下:
protected void GridView1_PageIndexCh ......