asp.net跨页投递
1.TextBox txt=(TextBox)PreviousPage.FindControl("TextBox1");
2.在页面注册投递页的属性
<%@ PreviousPageType VirtualPath="crouspostPage.aspx" %>
在crouspostPage.aspx的代码隐藏类中添加
public TextBox TextBox1
{
get(return _textbox);
}
在页面中Response.Write(PreviousPage.TextBox1.Text);
检测跨页投递
if(PreviousPage==null)
{
Response.Weite("sorry,This`s wrong way to invoke me");
Response.End();
return;
}
/////////如果从地址栏输入以下则会抛出异常
if(!PreviousPage.IsCrossPagePostBack)
{
......
}
///在目标页中,测试PreviousPage属性上的IsValid属性,并在答案否定的情况下中止请求
if(!PreviousPage.IsValid)
{
Response.Weite("sorry,This`s wrong way to invoke me");
Response.End();
return;
}
相关文档:
12 ASP.NET MVC Best Practices
M
DomainModel != ViewModel
Use ActionFilters for “shared” data
V
Do NEVER user code-behind
Write HTML each time you can
If there is an if, write an HtmlHelper
Choose your view engine carefully
C
Delete the AccountController
Isolate Controllers fro ......
///<summary>
///备份数据库到本地磁盘
///</summary>
public bool BackUp(string BackUpFile)
{
try
&nbs ......
学习自定义控件的开发不仅可以使你开发出更灵活的系统更重要的是它可以使你加深对已有服务器控件的理解,得以更灵活的应用。
较之于asp,asp.net提供了更强大的功能,我比较喜欢它的代码分离技术和对诸如C#、VB.Net等强类型语言的使用,这是从开发者的角度来看的,从用户的角度来看,会觉得它速度更快,运行更稳定, ......
<HTML><HEAD>
<TITLE>网页特效观止|JsCode.CN|---页面右下角弹出类似QQ或MSN的消息提示</TITLE>
<SCRIPT language=JavaScript>
<!--
/**//*
** ==================================================================================================
**&nbs ......
http://blog.csdn.net/chengking/archive/2005/10/27/518079.aspx
(一).选择会话状态存储方式
在Webconfig文件配置:
<sessionState mode="???" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString ......