Enter Movie Id :
OnClientClick i am calling a javacript function
function OnGetMovieDetailByMovieId()
{
var movieId = document.getElementById('<%= txtMovieId.ClientID %>').value;
MovieService.GetMovieDetailByMovieId(movieId, OnGetMovieDetailByMovieIdComplete, OnError)
}
and this function is calling Ajax-enable WCF service method from MovieService.
I have also defiend both callback function but when i click on button its get data from wcf web service and page again refresh and I lost data on page.
So why page is refreshing while i have only onclientclick of button.
Please suggest.
Thanks
Sandeep

Sukesh MarlaPosted Sep 30, 2012, 2:03 PM
function OnGetMovieDetailByMovieId()
{
var movieId = document.getElementById('<%= txtMovieId.ClientID %>').value;
MovieService.GetMovieDetailByMovieId(movieId, OnGetMovieDetailByMovieIdComplete, OnError)
return false;
}
Check this is correct answer if it helped/
Krishna GaradPosted Oct 1, 2012, 5:12 AM
Sandeep Singh ShekhawatPosted Oct 1, 2012, 2:23 AM
Sukesh MarlaPosted Oct 1, 2012, 1:52 AM
if you notice i have written return false in button.onclientClick , which notifies Browser not to postback.
Sandeep Singh ShekhawatPosted Sep 30, 2012, 9:41 PM
Sandeep Singh ShekhawatPosted Sep 30, 2012, 11:55 AM
I have implemented this but its not working means page is refreshing.
Shivanand ArurPosted Sep 30, 2012, 9:33 AM
{
var movieId = document.getElementById('<%= txtMovieId.ClientID %>').value;
MovieService.GetMovieDetailByMovieId(movieId, OnGetMovieDetailByMovieIdComplete, OnError)
return false;
}
Try adding the script which is bold in your function...