Sep 06, 2013, 9:03 AM
[CLOSED] Trouble setting checkbox from code behind to checked
Hi
It looks so simple that I am sure that I overlooked something important but I can't find it and it is bugging me for days without having found a solution on the web.
I just want to get that checkbox checked through code behind.
aspx:
It looks so simple that I am sure that I overlooked something important but I can't find it and it is bugging me for days without having found a solution on the web.
I just want to get that checkbox checked through code behind.
aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="demo.aspx.cs" Inherits="demo" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="Form" runat="server">
<ext:ResourceManager ID="ResourceManager" runat="server" />
<ext:Button runat ="server" OnClientClick="App.direct.onButtonClick()" Text="Open window" />
</form>
</body>
</html>
cs:using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
public partial class demo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
}
}
// On button click open window with checked checkbox
[DirectMethod]
public void onButtonClick()
{
Window win = new Window
{
Title = "Demo",
Items = { new Checkbox { FieldLabel = "checkbox", Checked = true } }
};
win.Render(this.Form);
}
}
Thank you very much.
Last edited by Daniil; Sep 06, 2013 at 2:07 PM.
Reason: [CLOSED]