ASP.NET跨页面传值技巧总结 关于页面传值的方法,引发了很多讨论。看来有很多人关注这个,我就我个人观点做了些总结,希望对大家有所帮助。
1. 使用QueryString变量
QueryString是一种非常简单的传值方式,他可以将传送的值显示在浏览器的地址栏中。如果是传递一个或多个安全性要求不高或是结构简单的数值时,可以使用这个方法。但是对于传递数组或对象的话,就不能用这个方法了。下面是一个例子:
a.aspx的C#代码
private void Button1_Click(object sender, System.EventArgs e)
{
string s_url;
s_url = "b.aspx?name=" + Label1.Text;
Response.Redirect(s_url);
}b.aspx中C#代码
private void Page_Load(object sender, EventArgs e)
{
Label2.Text = Request.QueryString["name"];
}2. 使用Application 对象变量
Application对象的作用范围是整个全局,也就是说对所有用户都有效。其常用的方法用Lock和UnLock。
a.aspx的C#代码
private void Button1_Click(object sender, System.EventArgs e)
{
& ......
一、认识Web.config文件
Web.config文件是一个XML文本文件,它用来储存 ASP.NET Web 应用程序的配置信息(如最常用的设置ASP.NET Web 应用程序的身份验证方式),它可以出现在应用程序的每一个目录中。当你通过VB.NET新建一个Web应用程序后,默认情况下会在根目录自动创建一个默认的
Web.config文件,包括默认的配置设置,所有的子目录都继承它的配置设置。如果你想修改子目录的配置设置,你可以在该子目录下新建一个Web.config文件。它可以提供除从父目录继承的配置信息以外的配置信息,也可以重写或修改父目录中定义的设置。
在运行时对Web.config文件的修改不需要重启服务就可以生效(注:<processModel> 节例外)。当然Web.config文件是可以扩展的。你可以自定义新配置参数并编写配置节处理程序以对它们进行处理。
二、web.config配置文件(默认的配置设置)以下所有的代码都应该位于
<configuration>
<system.web>
和
</system.web>
</configuration>
之间,出于学习的目的下面的示例都省略了这段XML标记
1、<authentication> 节
作用:配置 ASP.NET 身份验证支持(为Windows、Forms、PassPort、None四种)。该元素只能在计算机、站点或 ......
http://www.codeproject.com/KB/aspnet/ASPDOTNETPageLifecycle.aspx?msg=3443071#xx3443071xx
ASP.NET application and page life cycle
Introduction
The Two step process
Creation of ASP.NET environment
Process request using MHPM events fired
In What event we should do what?
A sample code for demonstration
Zooming ASP.NET page events
Source code
References
Introduction
In this article we will try to understand what are the different events which takes place right from the time the user sends a request, until the time request is rendered on the browser. So we will first try to understand the two broader steps of an ASP.NET request and then we will move in to different events emitted from ‘HttpHandler’, ‘HttpModule’ and ASP.NET page object. As we move in this event journey we will try to understand what kind of logic should go in each every of these events.
This is a small Ebook for all my .NET friends which covers topics like WCF,WPF,WWF,Aj ......
表简洁
"公交线路数据库"
用的sql数据库
admin表
username
password
admin
admin
busroute 表
车次
stop-name-id
站次
票价
68
4
1
1
34
5
6
1.5
25
6
3
2
站点表
id
stop-name
1
火车站
车次表
id
车次
1
1
如果要用基于vb.net的asp.net编程
登陆的时候该怎么编程啊,数据库是用sql做的id号是主键
,在68路第n个站点插入站点该怎么做呢? ......
原因就是IIS和.net Framework2.0安装顺序反了,因为我先前曾经装过VisualStudio2005,所以系统里先安装了.net Framework2.0,而这样后来装过IIS后,.net Framework未注册相关组件,不能对IIS做出修改,就会出现这种情况!
解决方法:
到C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727中找,有个工具叫 aspnet_regiis.exe,运行方法如下:
1.开始-->运行-->输入cmd,运行
2.DOS窗口打开以后,在DOS窗口内进入上面的文件夹
3.输入 aspnet_regiis.exe -i -enable
可以直接在VS2005的命令提示中输入aspnet_regiis.exe -i ......
最近做网站用到了上传控件,找到了一个界面比较好看的 Uploadify
看到别人的文章学会使用 。原文地址:
http://doc.chinaunix.net/web/201001/304549.shtml
不是转帖,自己写写自己的。一个完整的解决方案。包括文件上传,文件信息获取和显示,语言:C#
Upload.aspx //上传主页--主要是配置 jquery.uploadify-v2.1.0
html 代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Upload.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Uploadify</title>
<link href="JS/jquery.uploadify-v2.1.0/example/css/default.css" mce_href="JS/jquery.uploadify-v2.1.0/example/css/default.css" rel="stylesheet" type="text/css" />
<link href="JS/jquery.uploadify-v2.1.0/uploadify.css" mce_href="JS/jquery.uploadify-v2.1.0/uploadify.css" rel="stylesheet" t ......