protected void initWalls(int initialValue) { wallList.Items.Clear(); LiftDomain.Wall wall = new LiftDomain.Wall(); List <LiftDomain.Wall> wList = wall.doQuery <LiftDomain.Wall>("select"); foreach (LiftDomain.Wall w in wList) { wallList.Items.Add(new ListItem(w.title, w.id.Value.ToString())); } foreach (ListItem li in wallList.Items) { object val = li.Value; try { if (Convert.ToInt32(val) == initialValue) { li.Selected = true; } else { li.Selected = false; } } catch (Exception x) { string m = x.Message; } } }
protected void Page_Load(object sender, EventArgs e) { PageAuthorized.check(Request, Response); addBtn.Text = "Add new Wall"; if (IsPostBack) { LiftDomain.Wall newWall = new LiftDomain.Wall(); newWall.title.Value = wall_title.Text; newWall.user_id.Value = LiftDomain.Organization.Current.user_id.Value; newWall.doCommand("insert"); } wall_title.Text = ""; LiftDomain.Wall w = new LiftDomain.Wall(); DataSet wallSet = w.doQuery("get_walls"); wallListRenderer = new PartialRenderer(HttpContext.Current, wallSet, "_WallList.htm", new PartialRenderer.RenderHelper(render_helper)); }