R
ronc85
I'm using ASP.NET 2.0, C# and AJAX Extensions.
I need help calling a JavaScript function on the Server. I need to
come to the Server to execute a database call and then execute the
JavaScript.
I'm using a GridView column template containing a LinkButton. When the
User clicks the linkbutton the processing is as follows:
1. Make database call to get the URL.
2. If found call a javascript routine to open the URL in a new Window
(The URL is not part of my project).
3. If not found call a javascript to open a popup window.
How do I execute a JavaScript call on the Server? I need to execute a
database call first to get the URL which I then pass to the following
JavaScript routine.
function OpenWindow(sURL, reqWindowName, reqWidth, reqHeight) {
var leftPosition = (screen.width) ? (screen.width-reqWidth)/2 : 0;
var topPosition = (screen.height) ? (screen.height-reqHeight)/
2 : 0;
var sOptions = "toolbar=no, " +
"location=no, " +
"directories=no, " +
"status=yes, " +
"menubar=no, " +
"scrollbars=yes, " +
"resizable=yes, " +
"top=" + topPosition + ", " +
"left=" + leftPosition + ", " +
"width=" + reqWidth + ", " +
"height=" + reqHeight;
mywindow=open(sURL, reqWindowName, sOptions)
mywindow.focus();
}
Thanks,
Sal
I need help calling a JavaScript function on the Server. I need to
come to the Server to execute a database call and then execute the
JavaScript.
I'm using a GridView column template containing a LinkButton. When the
User clicks the linkbutton the processing is as follows:
1. Make database call to get the URL.
2. If found call a javascript routine to open the URL in a new Window
(The URL is not part of my project).
3. If not found call a javascript to open a popup window.
How do I execute a JavaScript call on the Server? I need to execute a
database call first to get the URL which I then pass to the following
JavaScript routine.
function OpenWindow(sURL, reqWindowName, reqWidth, reqHeight) {
var leftPosition = (screen.width) ? (screen.width-reqWidth)/2 : 0;
var topPosition = (screen.height) ? (screen.height-reqHeight)/
2 : 0;
var sOptions = "toolbar=no, " +
"location=no, " +
"directories=no, " +
"status=yes, " +
"menubar=no, " +
"scrollbars=yes, " +
"resizable=yes, " +
"top=" + topPosition + ", " +
"left=" + leftPosition + ", " +
"width=" + reqWidth + ", " +
"height=" + reqHeight;
mywindow=open(sURL, reqWindowName, sOptions)
mywindow.focus();
}
Thanks,
Sal