问题
how can i call a VB function - deleteevent() in usercontrol.ascx.vb from a javascript function in clickhandler(e) in usercontrol.ascx. The call should cause a postback because i need the usercontrol to display the changes.
i am currently trying to do it by using a linkbutton with style display:none, and calling its click event from the javascript function. But i dunno how to call the click event.
i had to pass a value to the vb function from the javascript, but i am taking care of it using a hiddenfield.
the environment is asp.net 3.0 language:vb
thanks.
KK
回答1:
Try looking at the __doPostBack function which is what ASP.NET uses to fire postbacks on linkbuttons and other controls, but can be used from any other JavaScriptcript function.
A good article on the topic with examples can be found here.
来源:https://stackoverflow.com/questions/743155/calling-a-vb-linkbutton-swithin-a-user-control-click-event-from-javascript