<p>I want to make custom control which has couple of <code>&lt;input type='checkbox' /&gt;</code> controls which I render in Render method.
Is it possible to retain ViewState (e.g. checked or not) on these Controls? </p>

<p>There is a way of doing this by using ASP.NET server CheckBox control, 
adding them in OnLoad event with this.Controls.Add(),
and giving them same Ids everytime, 
but I don't wat to do this :)</p>

You can just access the ViewState directly:
```
```
bool checked = (bool)(ViewState["ThisControlCheckState"] ?? false);
if (checked) {
    write("<input ... >");
}
else {
    write("<input ... >");
}
```
```
To save the value form the user, you could do something like this in the PostBack:
```
```
ViewState["ThisControlCheckState"] = request.Params["checkboxName"].ToString() == "1";
```
```