Get the value of a BoundField from a DetailsView

后端 未结 4 503
星月不相逢
星月不相逢 2021-01-20 02:43

I seem to always have problems with this. I have a button outside of the View that calls a function that needs an OrderNumber. I keep getting an error,

4条回答
  •  执笔经年
    2021-01-20 03:08

    There is no textbox in your details its a Cell. So u need to change your code.

    string sOrderNumber = Order_DetailsView.Rows[0].Cells[0].Text.ToString();
    int orderNumber = Int32.Parse(sOrderNumber);
    

提交回复
热议问题