i have two options
One
<%= Html.CheckBox("postType", false, new { @id = item.int_PostTypeId.ToString() })%>
Second
<input type="checkbox" name="postType" value="<%= item.int_PostTypeId.ToString() %>
1st question:
what is differenct between these two method of check box declaration.
2nd question:
and how can we get value of checked checkbox?
Use the Html.Checkbox (or even better the CheckBoxFor, in MVC2) if you use a model binder. It will handle the checkbox transparently to you, and you will read the boolean value on your model. It will render something more complicated than a checkbox (to avoid the problem which arises from the fact that an unchecked checkbox is not transmitted at all in a POST).
On the contrary, use the input if you retrieve the value via FormCollection: if you use the Html.Checkbox compound, you will receive something “strange” in the post (not the usual value, but a string with two testual values (like “true,false”). If you use the input, you just have to check if there exists that name in the post keys.