protected void Page_Load(object sender, EventArgs e) { using (ProductProvider provider = new ProductProvider()) { if (!string.IsNullOrEmpty(Request["nid"])) { try { Guid nid = new Guid(Request["nid"]); int lmaxVersion = provider.getMaxVersionByNomenID(nid) + 1; maxVersion = lmaxVersion.ToString(); } catch { maxVersion = ""; } } else { maxVersion = ""; } } }