473,378 Members | 1,383 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,378 software developers and data experts.

Problem: Open new browser window

Hello,

I have a aspx page on which I have a button. In the click event method
in code-behind I do some processing and now need to open a new window
in another browser and pass a couple of parameters.
I included in my aspx file, the following js function:
function OpenChecklist(strCaseID)
{
var url = "/ABC/DEF.aspx?qsSubjectID=" + strSubjectID
var f =
"width=700,height=450,left=75,top=75,status=no,too lbar=no,menubar=no,locati*on=no";

window.open(url,"Subject Checklist",f)

}
My codebehind has the following
Public Sub cmdSubject_ServerClick(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles cmdSubject.ServerClick

--do some processing here
-- now would like a way to call the method (passing some parameters)
and opening a new browser window
End Sub
Now how do I call this function, not from the onclick() event but from
within the click event procedure?
One way I was told is using onload function. Would appreciate is
someone could provide some more details on how to do this?

Aug 25 '06 #1
1 1425
This isn't really doable server side, but there are ways to work around it.
Opening a "popup" window is a client side action, performed using JavaScript.

What you will want to do is apply the JavaScript for your "cmdSubject"
button. To do this:

cmdSubject.Attributes.Add("onclick", "OpenCheckList(strCaseId)");

In this way, you won't have to perform a postback to popup the new window.
However, you will need to find a way to pass the variable "strCaseId" to the
JavaScript function. I would suggest storing this in a hidden field, or an
invisible div.

--
"Quae narravi, nullo modo negabo."
"na****@hotmail.com" wrote:
Hello,

I have a aspx page on which I have a button. In the click event method
in code-behind I do some processing and now need to open a new window
in another browser and pass a couple of parameters.
I included in my aspx file, the following js function:
function OpenChecklist(strCaseID)
{
var url = "/ABC/DEF.aspx?qsSubjectID=" + strSubjectID
var f =
"width=700,height=450,left=75,top=75,status=no,too lbar=no,menubar=no,locatiĀ*on=no";

window.open(url,"Subject Checklist",f)

}
My codebehind has the following
Public Sub cmdSubject_ServerClick(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles cmdSubject.ServerClick

--do some processing here
-- now would like a way to call the method (passing some parameters)
and opening a new browser window
End Sub
Now how do I call this function, not from the onclick() event but from
within the click event procedure?
One way I was told is using onload function. Would appreciate is
someone could provide some more details on how to do this?

Aug 30 '06 #2

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

Similar topics

1
by: Julius Mong | last post by:
Dear all, according to the ASV3 manual known problem section, to make an <a> execute some Javascript onclick: ...
5
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code...
10
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a...
5
by: John Morgan | last post by:
I am using the following link to download a file of about 50k <a target= "_blank" href="http://www.bsecs.org.uk/ExecDocs/documentStore/elfridaWord.doc">open file</a> If I save the file to...
3
by: Bob | last post by:
I am trying to create a popup page (to act as a menu) from a parent page. When the parent page (index.jsp) calls my popup function (see below) it will properly open the correct size browser window...
7
by: Mike | last post by:
Hi! I posted this question in browser_ctl group as well but got no results. I have a form with embedded WebBrowser. Upon clicking on a link in the embedded webbrowser that calls JavaScript's...
11
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as...
18
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to...
37
by: Jan Tovgaard | last post by:
Hey everyone:) We have a critical problem, which I can see that other people also has ran into. In Internet Explorer 7 it is no longer possible to do a window.close after opening a window,...
1
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.