473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Running Javascript with Ajax

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

Page.ClientScript.RegisterStartupScript(typeof(str ing), "OpenWindow",
"<script langauge='javascript'>OpenNewWindow('MyPage.aspx', '" + queryString
+ "', 'anotherName');</script>");

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?
Apr 3 '08 #1
2 1365
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(str ing), "OpenWindow",
"<script langauge='javascript'>OpenNewWindow('MyPage.aspx', '" + queryString
+ "', 'anotherName');</script>");

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?
Apr 3 '08 #2
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(str ing), "OpenWindow",
"<script langauge='javascript'>OpenNewWindow('MyPage.aspx', '" + queryString
+ "', 'anotherName');</script>");

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?
Apr 3 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sgmaat | last post by:
I have create a AJAX webpage where if you press a link content is loaded into a div. NOw when this content is loaded no javascript is processed (i.e <Script>alert(..);</script>), but if the...
3
by: wolis | last post by:
Hi all, In an AJAX environment, is it possible to load and display some HTML and JavaScript and have that JavaScript functional? I have tried but the JavaScript functions dont appear to be...
15
by: jacob navia | last post by:
Programming languages come and go. Still is amazing that in this survey from http://www.devsource.com/article2/0,1895,2016936,00.asp the C language comes second, right after Java. Java # What...
1
by: Ralph | last post by:
Okay I have a website where the user is going to hit a button to kick off a process that is going to take a long amount of time. Is there anyway without using AJAX, or possibly a windows control on...
0
by: Free Ebooks | last post by:
81 AJAX and 24 JavaScript Ebooks Here are some of the AJAX topics and areas covered by these ebooks: Rails and AJAX Building Ajax Web Applications Creating Ajax Web Pages Ajax Patterns Ajax...
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
2
by: Nathan Sokalski | last post by:
I am moving my website from my machine to my webhost, and need some help with what extra files I need to include due to the fact that I used AJAX in my site. Everything on the site is obviously...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.