Open a new browser window problem!!

N

nashak

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,toolbar=no,menubar=no,location=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?

Thanks
 
N

nashak

I'd appreciate if you could provide me with the exact steps that I need
to do.

I need to know how to call this onload method from the button click
event. Do I first create a onclick attribute in the <body> section of
aspx? If yes, then how do I handle the parameter that is being passed?
And what code should I write in button event handler to call this
onload function?

Thanks,
 
S

Steve C. Orr [MVP, MCSD]

Then examine its well documented source code to see how it works, and build
a similar solution from it.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


thanks, but i cannot use that control. I need to build this
functionality.


I suggest you just use the free control at the link I provided.
Scroll down to see the Popup window opener control.
The source code is included and a description for it so you can
understand
in more detail how it works if you choose.
http://SteveOrr.net/articles/ClientSideSuite.aspx




I'd appreciate if you could provide me with the exact steps that I need
to do.

I need to know how to call this onload method from the button click
event. Do I first create a onclick attribute in the <body> section of
aspx? If yes, then how do I handle the parameter that is being passed?
And what code should I write in button event handler to call this
onload function?

Thanks,

Steve C. Orr [MVP, MCSD] wrote:
Yes the onload method is probably the best way.
Another way would be to embed the JavaScript call to the method at the
end
of the page.

Here's more info:
http://SteveOrr.net/articles/ClientSideSuite.aspx




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,toolbar=no,menubar=no,location=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?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top