Click here to Skip to main content
15,891,673 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In ASP.net is the following code right ?
VB
Dim r1 As Bollean = rd1.checked 

returns what type of value?

then when I put this following code---
VB
If Request.QueryString("r1") = True Then
     myReportDocument.Load(Server.MapPath("Gradewise.rpt"))
End If'

It gives following error--

Conversion from string "" to type 'Boolean' is not valid.
Posted
Updated 27-Mar-13 21:31pm
v3

Have a look here: Checkbox.Checked property (web.ui.webcontrols)[^] and here: FindControl method[^]

VB
Dim myCbx As Control = CType(FindControl("CheckBox1"),CheckBox)
If Not myCbx Is Nothing AndAlso myCbx.Checked Then DoSomething()


Other resources: How to: Access Server Controls by ID[^]
 
Share this answer
 
VB
Dim r1 As Bollean = rd1.checked


the output of this will be a string but boolean will not accept string characters so use it in below way.

Dim r1 As Bollean = Convert.ToBoolean(rd1.checked)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900