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

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

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

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

 

 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了,求解啊,多谢,快点哦

 

 

相关文章:

  • 2021-07-23
  • 2022-12-23
  • 2022-01-15
  • 2021-11-07
  • 2021-08-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2021-12-31
  • 2022-12-23
  • 2022-01-28
相关资源
相似解决方案