try...
this.page.RegisterClientSc
Main Topics
Browse All Topicshello,
I am writing a c# asp.net application which uses AJAX.
I have added a timer to my updatePanel which calls a function every 4 seconds.
protected void updateData(object sender, EventArgs e)
{
ClientScript.RegisterClien
GetReports();
}
I want to call a javascript function "setScroll()" which is written in the client side, every time the updatePanel is updated.
This doesn't work.
The call to the server side function "GetReports()" works fine.
I also tried to change the call to "setScroll" to a simple alert but this doesn't work either.
What am I doing wrong?
Thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thank you both for your help but...
x_com: Trying Response.write pops up the following message:
"Sys.WebForms.PageRequestM
cezarF: Your solution did not help either. The UpdateData is called but the javascript function is not called from it.
Dear Relegence,
I'm not sure how your call updateData function in your code.
You can try put a label to solve the problem.
eg:
protected void updateData(object sender, EventArgs e)
{
LblText.Text="<script language='javascript'>setS
GetReports();
}
Otherwise, you can try call client script before access updateData function.
I am using AJAX on this page. I have a gridView inside an updatepanel with a timer.
he timer calls "UpdateData" every 4 seconds.
"UpdateData" calls "GetReports()" which updates the gridview data in an "elegant way" so that only the grid refreshes and not the whole page.
The page is posted back every 4 seconds
try placing the RegisterClientScriptBlock on itemDataBound of your grid. I had the same proj before where i need to scroll down (using javascript) to the row in the grid when the user clicks on "Edit" button.
or
since you are using AJAX, call the setScroll() when your AJAX XMLHttpRequest returns .readyState == 4 && .status == 200
Well, after searching the internet for information about my problem, I found the following article:
http://developers.de/blogs
It explains why there is a problem with registering script blocks within update panels. It also offers a solution which works:
ScriptManager.RegisterStar
Thank you so much for trying to help!!!
Business Accounts
Answer for Membership
by: x_comPosted on 2007-08-25 at 11:12:42ID: 19768624
Dear Relegence, croll()</s cript>");
What is the function for "setScroll()"? Have you tried with Response.Write method to call client script?
eg:
protected void updateData(object sender, EventArgs e)
{
Response.Write("<script language='javascript'>setS
GetReports();
}