易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.NET 登录界面

//default.aspx.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Runtime.InteropServices;
using System.Configuration;
using System.Web.UI.WebControls;
using System.Web.Services.Description;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button4.Attributes.Add("onclick", "window.open('Register.aspx')");//通过button4打开链接
string strConnection = ConfigurationManager.AppSettings["Str.Properties.Settings.masterConnectionString"].ToString();
SqlConnection objConnection = new SqlConnection(strConnection);
objConnection.Open();
SqlCommand cmd = new SqlCommand("select * from judging where name='" + TextBox1.Text.Trim() + "'", objConnection);
string sql = "select * from judging where name='" + TextBox1.Text + "'and password='" + TextBox2.Text + "'";
cmd.CommandText = sql;
/*
***********************************************************************************************
*判断是否有此ID,ExecuteScalar() return the first column of the first row in the result set.
*/
if (cmd.ExecuteScalar() == null)//无此用户
{
Label1.Text = "Sorry, please check your id and psw";
Button3.Visible = false;
}
else
{
Label1.Text ="Welcome to "+TextBox1.Text;
Button3.Visible = true;
}

}
protected void Button1_Click(object sender, EventArgs e)
{
Panel1.Visible = false;
Panel2.Visible = true;
}
protected void Button4_Click(object sender, EventArgs e)
{

}
protected void Button3_Click(object sender, EventArgs e)


相关文档:

asp.net 去掉viewstate

解决办法:app_code/ 存放一个类 用来截获HTTP
1.代码如下
using System;
using System.IO;
using System.Web;
using System.Text;
using System.Text.RegularExpressions;
/// <summary>
/// Removes whitespace from the webpage.
/// </summary>
public class ViewstateModule : IHttpModule
{
......

在asp.net AJAX客户端使用复杂数据类型方法

<script language="javascript" type="text/javascript"> 
  function doubleSalary()
  {
  var employee = new Object();
  employee.FirstName = "X";
  employee.LastName = "PP";
  employee.Salary = 1000;
......

在 ASP.NET 网页中不经过回发而实现客户端回调

在 ASP.NET 网页中不经过回发而实现客户端回调
在 ASP.NET 网页的默认模型中,用户会与页交互,单击按钮或执行导致回发的一些其他操作。此时将重新创建页及其控件,并在服务器上运行页代码,且新版本的页被呈现到浏览器。但是,在有些情况下,需要从客户端运行服务器代码,而不执行回发。如果页中的客户端脚本维护一些状态 ......

解决ASP.NET上传文件大小限制

一、修改配置Web.Config文件中的httpRuntime节点
对于asp.net,默认只允许上传4M文件,增加如下配置,一般可以自定义最大文件大小.
一、修改配置Web.Config文件中的httpRuntime节点
对于asp.net,默认只允许上传4M文件,增加如下配置,一般可以自定义最大文件大小.
<httpRuntime
executionTimeout="800"
maxRequestLengt ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号