Friday 15 April 2011

vb.net - How to call javascript function from httphandler -



vb.net - How to call javascript function from httphandler -

hi question simple, how can phone call javascript function runexec() httphandler? doesn't work

scriptmanager.registerstartupscript(me, me.gettype(), "myfunction", "runexec();", true)

it gives me next error

error 5 overload resolution failed because no accessible 'registerstartupscript' can called these arguments: 'public shared sub registerstartupscript(control system.web.ui.control, type system.type, key string, script string, addscripttags boolean)': value of type 'sample' cannot converted 'system.web.ui.control'. 'public shared sub registerstartupscript(page system.web.ui.page, type system.type, key string, script string, addscripttags boolean)': value of type 'sample' cannot converted 'system.web.ui.page'. c:\users\fares\desktop\remotepayment 13.10.2014\sample.ashx 144 17 c:\...\remotepayment 13.10.2014\

help?

according msdn, http handlers "endpoints". can't prompt clients run javascript code. http handlers responding request, think can can write javascript code response , in client browser runs. thing this:

public sub processrequest(context httpcontext) ... context.response.write("<script>mufunc();</script>") ... end sub

this works when request text/html request.

javascript vb.net httphandler

No comments:

Post a Comment