javascript - How to pass 2 parameters through RegisterStartupScript? -


i have javascript function "initialize (latitude, longitude)" , when click on button want pass value textbox something.

protected sub btnlat_click(byval sender object, byval e system.eventargs)     dim latit textbox = formview.findcontrol("nr_latitudetextbox")     dim longit textbox = formview.findcontrol("nr_longitudetextbox")      page.clientscript.registerstartupscript(me.gettype(), "initialize", "initialize(" & latit.text, longit.text & ");", true) 

end sub

but when try e error

overload resolution failed because no accessible "registerstartupscript" accepts number of arguments. 

you have implemented code wrongly. change to.

if initialize function expects string variables use code;

page.clientscript.registerstartupscript(me.gettype(),  "initialize", "initialize('" & latit.text & "','" & longit.text & "');", true) 

if initialize expects integers then;

page.clientscript.registerstartupscript(me.gettype(),  "initialize", "initialize(" & latit.text & "," & longit.text & ");", true) 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -