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:
......
using System;
using System.Web;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
public partial class images_code : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string chkCode = string.Empty;
//颜色列表,用于验证码、噪线、噪点
Color[] col ......
在学习过程中发现如果要上传的照片很大的话,速度会很慢,所以采用了在上传照片时同时上传缩略图的方式,这样就可以既不影响多个图片的浏览,又不影响查看具体的图片。
需要用到的命名空间:
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
#region 保存上传文件,方法名:UploadSave(string ......
ASP.NET 成功的其中一个原因在于它降低了 Web 开发人员的门槛。即便您不是计算机科学博士也可以编写 ASP.NET 代码。我在工作中遇到的许多 ASP.NET 开发人员都是自学成材的,他们在编写 C# 或 Visual Basic® 之前都在编写 Microsoft® Excel® 电子表格。现在,他们在编写 Web 应用程序,总的来说,他们所做的工 ......