Running Javascript with Ajax

Running Javascript with Ajax

am 03.04.2008 20:54:02 von Wannabe

I have a page that has the following Javascript on it:

Page.ClientScript.RegisterStartupScript(typeof(string), "OpenWindow",
"");

I was asked to add Ajax to the grid so it would load faster. Trouble is when
I did that, it broke the above line of code. When a user selects an item in
the grid, it should open a new window with the information from the row they
clicked. I verified that the code is being hit, but the javascript does not
run. Can anyone tell me how I can get the javascript to run with it being in
an Ajax update panel?

RE: Running Javascript with Ajax -- Fixed

am 03.04.2008 21:30:02 von Wannabe

I found out that I needed to be using ScriptManager.RegisterStartupScript,
then it worked as before.

"Wannabe" wrote:

> I have a page that has the following Javascript on it:
>
> Page.ClientScript.RegisterStartupScript(typeof(string), "OpenWindow",
> "");
>
> I was asked to add Ajax to the grid so it would load faster. Trouble is when
> I did that, it broke the above line of code. When a user selects an item in
> the grid, it should open a new window with the information from the row they
> clicked. I verified that the code is being hit, but the javascript does not
> run. Can anyone tell me how I can get the javascript to run with it being in
> an Ajax update panel?

RE: Running Javascript with Ajax

am 03.04.2008 22:29:00 von pbromberg

Adding "AJAX" to a grid won't make it load faster. It still has to go to the
server, execute the method that gets the data, and marshal it back over
XMLHTTP to repopulate the grid. In fact, because of the client-side JSON
script manipulation, it may very likely load "slower".
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net


"Wannabe" wrote:

> I have a page that has the following Javascript on it:
>
> Page.ClientScript.RegisterStartupScript(typeof(string), "OpenWindow",
> "");
>
> I was asked to add Ajax to the grid so it would load faster. Trouble is when
> I did that, it broke the above line of code. When a user selects an item in
> the grid, it should open a new window with the information from the row they
> clicked. I verified that the code is being hit, but the javascript does not
> run. Can anyone tell me how I can get the javascript to run with it being in
> an Ajax update panel?