Calling a vb linkbutton’s(within a user control) click event from javascript

只愿长相守 提交于 2019-12-25 03:11:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!