Disabling AutoPostBack on Button.Click() to activate Javascriptfunction

M

maximz2005

Hi,

I'm currently writing an ASP.NET application for a demonstration with
hydrological web services.
I'm having a problem: I obtain a certain latitude and longitude for a
point via web services in C#, and then, I need to pass those variables
to a javascript function that draws a marker on a map for me.
When I press the button to obtain the latitude and longitude and draw
a marker, the page postbacks and refreshes, so the marker isn't drawn.

I'm using Page.RegisterClientScriptBlock(...) to activate the
Javascript function I have called AddMarker(lon, lat) .

I've tried disabling EnableViewState for the form my button is in and
the button itself, but it doesn't help. How can I accomplish this?

Thank you so much!
-Maximz2005
 
M

maximz2005

I think I solved the problem - I transformed the ASP:button into an
HTML button, which gets C# values through Javascript.

Thank you
-maximz2005
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top