TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sandeep Singh Shekhawat
NA
19.9k
30.3m
Why page is refreshing on onclientClick of asp button?
Sep 30 2012 8:51 AM
I have a .aspx page and it has one text box and button Like:
Enter Movie Id :<asp:TextBox ID="txtMovieId" runat="server"></asp:TextBox>
<asp:Button ID="btnSubmit" runat="server" Text="Movie Detail" OnClientClick="OnGetMovieDetailByMovieId()" />
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
Reply
Answers (
7
)
WCF Example for Inserting and Displaying Data from SQL Server Database Using WCF Service in ASP.NET
caching data into a object on WCF Services