May be you could try this way.
1. By pressing the button in the user control, you call a javascript function.
2. Then, in the javascript, you could call the functions in the script.
If you need to pass in some of the parameters, set the parameters into
ViewState parameter in user control and retrieve it in the function in aspx
page
If you need to return something from the aspx page, e.g. dataset, datatable,
string etc. Use back the same mechanism, the script and viewstate.
or a better suggestion, make your function in a class, in your aspx, call
the function from class, and also you can call it from your user control.
Let me know whether it works. Thanks
"rom" wrote:
I have an user control inside me aspx page and I want a
button in the user control to call a sub in the aspx page.
is it possible?
I tried to several things like:
1. just call the className.SubName but I get error "Object
reference not set to an instance of an object...."
2. I tried:
Dim cls As myClassName = New myClassName
cls.SubName
this way I can reach the sub, but when I'm inside the sub,
if try to write to a label control on that page (the
sub+label are in the aspx page) then I get the same error
message...Object reference not set......
Any Ideas?