提个问题,求高手解决,关于页面上的属性值问题

提个问题,求高手解决,关于页面上的属性值问题

本人做页面比较多点,对运行的机制问题,不是很理解,现在有个问题求高手解决啊!

就是我在页面上设置了一个属性,但是在按钮提交事件的过程中,断点测试发现,其值为空

我贴出我的代码,求高手指点指点啊。

 

ContractedBlock.gif ExpandedBlockStart.gif Code
    public int ProductID
    {
        
get
        {
            
try { return int.Parse(Request.QueryString["id"]); }
            
catch {return 0;}
        }
    }
    
public int ProductShopID = 0;
    
public string ProductName = "";
    
public string Price = "";
    
public string MakeRegion = "";
    
public string ProductShopAddress = "";

    
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        COrder order 
= new COrder();
        SortedList items 
= new SortedList();
        items.Add(
"OrderShopID"this.CurrentShop.PKID);
        items.Add(
"ProductShopID", ProductShopID);
        items.Add(
"OrderDate", DateTime.Now.ToString());
        items.Add(
"ProductsCount", txtcount.Text.Trim());
        
string address = "";
        
if (dpdprovoince.SelectedIndex > 0 && dpdcity.SelectedIndex > 0 && txtaddress.Text != "")
            address 
= string.Format("{0}-{1}-{2}", dpdprovoince.SelectedItem.Text, dpdcity.SelectedItem.Text, txtaddress.Text.Trim());
        
else
        {
            Label1.Text 
= "请选择并填写您的地址";
            
return;
        }
        items.Add(
"Address", address);
        items.Add(
"PostCode", txtpostcode.Text.Trim());
        items.Add(
"ReceieveName", txtrename.Text.Trim());
        items.Add(
"Telephone", txttele.Text.Trim());
        items.Add(
"Mobile", txtmobile.Text.Trim());
        items.Add(
"ProductID", ProductID);

        
if (order.Add(items))
            Common.Alert(
"订单发布成功");

    }

 

 

本人就是搞不懂在提交的时候,为什么 ProductID 这个属性变成null了,求解啊,多谢,快点哦

 

 

转载于:https://www.cnblogs.com/Longkin/archive/2008/08/26/1276393.html

  • 0
    点赞
  • 0
    收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值