private void Bind() { if (!string.IsNullOrWhiteSpace(Request.QueryString["Id"])) { Guid.TryParse(Request.QueryString["Id"], out Id); } if (!Id.Equals(Guid.Empty)) { ProductStock bll = new ProductStock(); var model = bll.GetModel(Id); if (model != null) { hProductStockId.Value = model.Id.ToString(); txtName.Value = model.StockNum.ToString(); if (myDataAppend == null) { myDataAppend = new StringBuilder(); } myDataAppend.Append("<div id=\"myDataForModel_ProductStock\">["); myDataAppend.Append("{\"ProductId\":\"" + model.ProductId + "\",\"ProductItemId\":\"" + model.ProductItemId + "\",\"ProductSize\":\"" + model.ProductSize + "\"}"); myDataAppend.Append("]</div>"); } } }