Interacting with HTTP controls

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
Hi,

Have added a html checkbox to my asp.net page. How can I directly set the value of this checkbox from my VB.NET code.

Mike55.
 
Assuming you have properly declared the checkbox in your code, and assuming that you're properly setup the control in your .aspx (by setting runat=server and giving the control an 'id' tag) then regardless of whether you're using an ASP.Net Checkbox webcontrol or an HtmlInputCheckbox you would set its 'Checked' property.

chkControlName.Checked = True
chkControlName.Checked = False

Paul
 
Yea, I figured out how to call the control and set its value grand. The problem that I am getting is: "Object reference not set to an instance of an object".

Let me explain what I am trying to do, I aquired the Janus Web Grid for .NEt from Janusys. This grid allow you to group data according to a specific field. What I was trying to do is insert a checkbox on the top of each group, which would then allow me to select all the checkboxes in that group (that working - used javascript from Janusys). Now I am trying uncheck the checkbox for a particular group if after checking it, i uncheck one of the checkboxes under the group.

Any suggestions.

Mike55
 
What html are you using to declare the textbox and what code are you using to declare the checkbox in the code behind?
 
Back
Top