asp.net弹出确定或警告
在没有<asp:UpdatePanel ID="up" runat="server"> <ContentTemplate>无刷新环境中:
Response.Write("<script>alert('恭喜您,已成功加入到您的人才库!');</script>");
在有<asp:UpdatePanel ID="up" runat="server"> <ContentTemplate>无刷新环境中:
ScriptManager.RegisterStartupScript(this.up, this.GetType(), "msgl", "alert('您还没有登录,请先登录!');", true);
点击按钮时弹出窗口有:
/// <summary>
/// 在ASP.NET AJAX环境中弹出一个对话框
/// </summary>
/// <param name="button"></param>
/// <param name="message"></param>
public static void ShowAjaxDialog(Button button, string message)
{
ScriptManager.RegisterClientScriptBlock(button, typeof(Button), button.ClientID,
"alert(\"" + message + "\");", true);
}
/// <summary>
/// 说明:MessageBox用来在客户端弹出对话框。
/// 参数:TxtMessage 对话框中显示的内容。
/// </summary>
public string MessageBox(string TxtMessage)
{
string str;
str = "<script language=javascript>alert('" + TxtMess
相关文档:
如果你已经有较多的面向对象开发经验,跳过以下这两步:
第一步 掌握一门.NET面向对象语言,C#或VB.NET 我强烈反对在没系统学过一门面向对象(OO)语言的前提下去学ASP.NET。 ASP.NET是一个全面向对象的技术,不懂OO,那绝对学不下去!
第二步 对.NET Framework类库有一定的了解 可以通过开发Windows Form应用程 ......
设置SharpDevelop,使其能编写和运行Asp.net。
在看下文的时候,请确定您的系统装上了IIS,FontPage扩展,装了.Net框架。好现在开始我的讲述。
如果您装的.Net框架是1.1版的,请生成以下BAT文件。
文件:Asp.Net_1.1_Setup.bat
c:
......
最近的项目开发中 遇到一些需要根据具体情况动态添加javaScript脚本,然后执行脚本 于是收集了一下:
1 在控件的绑定事件中添加脚本 如:在gridview控件的rowdatabind事件中可以实现 指针的选中行不同色显示 可添加脚本
protected void gvEngineerRepairState_RowDataBound(object sender, GridViewRowEventArgs e ......
ASP.NET 2.0
文件1: Deafault.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&l ......