Link to home
Start Free TrialLog in
Avatar of countrymeister
countrymeister

asked on

How to invoke a checkbox change event within code behind

I have an ASP.NET page, I have a checkbox which has a checkbox change event.

How do I trigger a checkbox change event from code behind.

I tried to add this line in one of my methods to inovke the changed method
But it fails with object reference set to an instance of an object, because the value of System.Web.HttpUtility.UrlDecode(Request.Form("__EventTarget")) is Nothing



cbDetailOrder_SelectedIndexChanged(cbDetailOrder, New EventArgs())



Protected Sub cbDetailOrder_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbDetailOrder.SelectedIndexChanged

      If System.Web.HttpUtility.UrlDecode(Request.Form("__EventTarget")).EndsWith(cbDetailOrder.ID) Then
            'blah blah

      end if
End SUb
ASKER CERTIFIED SOLUTION
Avatar of Gorkem Yuksel
Gorkem Yuksel
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of countrymeister
countrymeister

ASKER

gyuksel:
If I do the following
cbDetailOrder_SelectedIndexChanged(nothing, nothing)

as I already mentioned it fails
because the EVENTTARGET is empty
carl_tawn:
I need to invoke the checkbox changed event, not sure if I can use Page,RegisterClientScript or somehow get the document checkbox changed event.

I have a link on a another page, which uses the query string to pass the order id. and on getting the order id I want to use cb_changed event to load the details of the orderid passed
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't think any one of them answered my question