你要用提示框,应该Response.Write("<script language='JavaScript'>alert('hi');</script>");
解决方案 »
- 页面加载/数据读取过程中,给予loading提示
- JQuery中冒号冲突?
- 在iis中设置了一个自定义的404页面,为什么点击不存在页面时,老是跳到搜搜网页上去了啊?
- 高手帮忙:asp.net调用类里定义的函数来 Label控件 或 GridView控件里显示数据
- WebService请求提示版本不对怎么解决啊?
- 急求!!我在label控件中打开一个数据库的一个字段值,为什么没有显示呀?源码如下:
- 我的cookie为什么总是提前过期?
- FREETEXTBOX3.0我的为什么第一次编译,所有的按扭全能显示,而第二再找页面.有的却显不了.
- (常见,高分求)输入框中检查不包含sql语句的保留字?
- var returncheckQQ = function checkQQ() {...return false;},returncheckQQ能到到返回值吗
- 简单问题,高分求助(3)
- 如何将用asp.net生成的数据库表单通过程序在客户端保存为word文档?
ButtonColumn不能加id属性啊
<asp:ButtonColumn Text="删除" CommandName="Delete"></asp:ButtonColumn>后台事件private void DataGrid1_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
int id=e.Item.ItemIndex; //Here you can write down delete sentences Response.Write("the id of rows you would delete is "+id); }
Overloads Public Shared Function Show( _
ByVal owner As IWin32Window, _
ByVal text As String, _
ByVal caption As String, _
ByVal buttons As MessageBoxButtons, _
ByVal icon As MessageBoxIcon, _
ByVal defaultButton As MessageBoxDefaultButton, _
ByVal options As MessageBoxOptions _
) As DialogResult参数:
owner
IWin32Window,消息框将显示在其前面。
text
要在消息框中显示的文本。
caption
要在消息框的标题栏中显示的文本。
buttons
MessageBoxButtons 值之一,它指定在消息框中显示哪些按钮。
icon
MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
defaultButton
MessageBoxDefaultButton 值之一,它指定消息框的默认按钮。
options
MessageBoxOptions 值之一,它指定将用于消息框的显示和关联选项。注意:
MessageBoxOptions 值要选择Windows.Forms.MessageBoxOptions.ServiceNotification,否则会报错。解决了吗?给我加分吧!:)
private void showmessage(string msg) //自己定义一个showmessage函数
{
string a1,a2,a3;
a1="<script language='javascript'>window.alert('";
a2="')<";
a3="/script>";
Response.Write(a1+msg+a2+a3); //调用script的alert显示提示框
}然后你就自由地用showmessage()函数,里面放上你想提示的字符串就行。你还可以把alert改为confirm,就变成一个有两个按钮的提示框。
Page.RegisterStartupScript("","<script>alert('比较完美');</script>");
js---->alert用在web-forms
你这句话加在什么位置?
private void Page_Load(object sender, System.EventArgs e)
{
btnAdd.Attributes.Add("OnClick","return confirm('确定要提交吗?');");
if(this.IsPostBack)
return;
}
response.write("<script language=javascript>
var bConfirmed=window.confirm('说上几句什么');
if (bConfirmed){
window.open('http://...');
}
window.top.location='http://...';
</script>");