首页 新闻 赞助 找找看

页面间Server.Transfer跳转传值的问题

0
悬赏园豆:50 [已关闭问题]

项目后台中,信息管理的修改我多处使用了Server.Transfer跳转页面并传值信息ID的方式,当对解决方案重新生成后,对项目生成网站时,经常会提示“找不到类型或空间名称“XXXXXX””的出错信息。例如:

A页面CS代码段:

public partial class PtSale : System.Web.UI.Page
{
    internal string ProductId;//商品信息ID

    protected void Page_Load(object sender, EventArgs e)
    {。。。。。。}

 //编辑事件,当点击GridView 中的修改时,Server.Transfer到B页面。
    protected void Gvw_RowEditing(object sender, GridViewEditEventArgs e)
    {
        if (this.IsPostBack)
        {
            GridViewRow row=this.Gvw.Rows[e.NewEditIndex];
            if (row!=null)
            {
                this.ProductId = ((HiddenField)row.FindControl("HdfProductId")).Value;
                this.Server.Transfer("EditProduct.aspx");
            }
        }
    }

B页面CS代码段:

public partial class EditProduct : System.Web.UI.Page
{
    private string AttribValueIds;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.GetProductId();
            this.SetData();
        }
    }


    private void GetProductId()
    {
        if (this.Context.Handler is PtSale)
        {
            PtSale saleForm = (PtSale)this.Context.Handler;
            this.HdfProductId.Value = saleForm.ProductId;
            this.HdfRequestUrl.Value=saleForm.Request.Url.ToString();
        }

        if (this.HdfProductId.Value.Equals("0"))
            this.Response.Redirect("ErrorPage.aspx");
    }

  ..........

 

在编译生成网站时,会出现出错提示“找不到类型或命名空间名称“PtSale””。如果继续使用在浏览器中查看,跳转到B页面后也是出现此类错误。

请问要如何解决此问题?或者如何显式写明B页面的命名空间名称?

 

 

boralin的主页 boralin | 初学一级 | 园豆:150
提问于:2010-04-14 14:10
< >
分享
其他回答(1)
0

Using System.程序集名称.类名

剑迅 | 园豆:240 (菜鸟二级) | 2010-04-14 18:42
0

HttpContext.Current.Server

^Blood^ | 园豆:210 (菜鸟二级) | 2010-04-15 20:24
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册