有什么好的办法呢?
要么用Session,有点浪费内存。
要么用Session,有点浪费内存。
解决方案 »
- 多少人用Developer Express .NET
- CuteEditor 文本内容发现无效字符
- 遇到好几位老大都说从网页提取纯文本,用正则表达式不久可以了吗,真这么简单?
- UpdatePanel控件 能不能人为控制他刷新?
- 想用asp.net2.0做个论坛,谁有相关教程。
- sql问题
- ActiveReport问题:在GroupFooter里放一Lable,如果动态改变Lable的值?
- 怎样为一控件设置输入焦点?
- System.Data.SqlClient.SqlException 超时时间已到.怎么办?
- .net中的ACCESS数据库的连接字符串怎么写
- 求教~~~关于ASP2.0部署项目的问题
- 求助生成静态新闻列表并分页
传递参数有两种方法:
方法1、地址栏传参
方法2、Form传参。如果是ASP.net的话,任何数据都是可以在服务器段运行,所以并不需要传递参数,定义一个类,保留这些参数的值不就可以了
<asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="5">
<ItemTemplate>
<a href=' <%# DataBinder.Eval(Container.DataItem, "EpId","Enterprise.aspx?id={0}")%>' target="_blank">
<asp:Image ID="Image1" BorderColor="#00ccff" BorderWidth="1" runat="server" Width="120" Height="90" ImageUrl='<%# DataBinder.Eval (Container.DataItem,"EpLogoImg","img\\EpLogo\\{0}")%>' /></a>
</ItemTemplate>
</asp:DataList>-----------------------这是ASPX.CS的代码-------------------------------
public partial class Enterprisesearch : System.Web.UI.Page
{
dbclass sqlcon = new dbclass();
DataSet ds = new DataSet(); protected void Page_Load(object sender, EventArgs e)
{
string id = (Request.QueryString["id"]).ToString();
if (!Page.IsPostBack)
{
sqlcon.RunSQL("select * from User where ispass=1 and EpId in (" + id + ") order by EpId desc", ref ds, "EpDiscount");
DataList1.DataSource = ds.Tables["EpDiscount"];
DataList1.DataBind();
Title = "优惠券分类频道";
}
}
}
//user_friends.asp例外
if(top.location.href.indexOf('user_index.asp')<=0){
//alert(self.location.href);
if(self.location.href.indexOf('user_friends.asp')<=0&&self.location.href.indexOf('user_comments.asp')<=0&&self.location.href.indexOf('user_messages.asp')<=0&&self.location.href.indexOf('user_url.asp')<=0){
var aa=self.location.href.split("/");
var bb=aa[aa.length-1];
bb=bb.replace(/\&/g,'$');
top.location.href="user_index.asp?url=" + bb;
}
}
有适用的答案追加40分
加密解密,你可以参考一下:
http://www.cnblogs.com/JBoy/archive/2007/06/17/786799.html
CSDN搜索之后的页面就是这个地址
我就是想要这个效果啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
这样就可以实现你要的效果了
或者
escape(参数)
dim url as string
url = "localhost/example.aspx?id=" & Server.Encode("任意汉字")
……这样在地址栏显示的就是localhost/example.aspx?id=%23%32%77……如果是使用javascript就使用escape()来转换字符