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;
}
相关文档:
asp.net多频道网站开发架构浅析 http://www.cnblogs.com/Kenny-Jiang/archive/2007/07/31/837900.html 背景:
我们打开门户网站时,往往会看到很多排列紧密的频道列表,如“新闻”、“财经”、“娱乐”等。频道为网站提供了方便的导航功能。
内容描述:
......
///<summary>
///备份数据库到本地磁盘
///</summary>
public bool BackUp(string BackUpFile)
{
try
&nbs ......
<HTML><HEAD>
<TITLE>网页特效观止|JsCode.CN|---页面右下角弹出类似QQ或MSN的消息提示</TITLE>
<SCRIPT language=JavaScript>
<!--
/**//*
** ==================================================================================================
**&nbs ......
偶尔使用,简单的记录下过程
1.下载Newtonsoft.Json.Net20.dll后,放入Asp.net项目Bin文件夹中.
Newtonsoft.Json.Net20,是一个Object/Json转换工具,这里用来把对象转换成Json格式字符串.
2.树节点Model对象,
public class TreeModel{
private string _i ......
在ASP.NET中,我们可以用下面的方法实现从数据库中读取图片并显示在页面上,方法如下:
SqlConnection conn=new SqlConnection(ConfigurationSettings.AppSettings["ConnStr"]);
String sql="SELECT image from append where id='" + strID + "'";
&n ......