页面间值的获取

来源:互联网 发布:对流风和穿堂风知乎 编辑:程序博客网 时间:2024/04/27 22:45

 

前台

<ahref="/shujuku/users/show.aspx?id=<%=Session["yonghuID"]%>">我的主页</a>

注意:sqldatasource里面不能用这个,不然会提示错误。

 

 Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","/shezhi.aspx?id="+Session["yonghuID"].ToString());

 

 

<asp:SqlDataSourceID="sqlKaideke"runat="server"ConnectionString="<%$ ConnectionStrings:isharingConnectionString %>"

        SelectCommand="SELECT *FROM [Lcts]WHERE ([yonghuID] = @yonghuID)">

        <SelectParameters>

            <asp:SessionParameterName="yonghuID"SessionField="yonghuID"Type="Int64"/>

        </SelectParameters>

    </asp:SqlDataSource>

 

 

public string strid ="";

strid = Request.Params["id"];//从页面的QueryStringFormCookiesServerVariables里检索名称为“id”的值。

<ahref="/shujuku/lcts/modify.aspx?id=<%=strid%>">但是</a>

 

<ahref="/shujuku/mirolcts/show.aspx?id=<%#Eval("weikeID")%>">

 

 

    file: "<%=shipinURL%>",

                   image: "<%= wkFengmianURL%>",

 

src='<%#DataBinder.Eval(Container.DataItem, "kcFengmianID")%>'

 

后台

if (Session.Count<= 0 || Session["yonghuID"] ==null)//session小于0或者yonghID为空,则登陆失败

            {

               pDenglu.Visible = true;//显示登录按钮

            }

            else

     Image1.ImageUrl = Session["touxiangUrl"].ToString();

               //获取管理员类型

        stringyhLeixing = Session["yhLeixingID"].ToString();

Request.Params["id"]

    strid =Request.Params["id"];

 

 

dbo.[Lcts-gzUsers]

INNER JOIN

dbo.Lcts

ON dbo.[Lcts-gzUsers].kechengID =dbo.Lcts.kechengID

INNER JOIN

dbo.Users

ON

dbo.[Lcts-gzUsers].yonghuID =dbo.Users.yonghuID AND dbo.Lcts.yonghuID = dbo.Users.yonghuID

0 0
原创粉丝点击