Saturday, March 24, 2012

Open a new browser window problem!

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,tool bar=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?

ThanksYes 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
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
<nashak@.hotmail.comwrote in message
news:1156454777.016791.137500@.m73g2000cwd.googlegr oups.com...

Quote:

Originally Posted by

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,tool bar=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
>


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 <bodysection 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:

Quote:

Originally Posted by

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
>
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
>
>
<nashak@.hotmail.comwrote in message
news:1156454777.016791.137500@.m73g2000cwd.googlegr oups.com...

Quote:

Originally Posted by

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,tool bar=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


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 hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
<nashak@.hotmail.comwrote in message
news:1156467190.273771.261480@.h48g2000cwc.googlegr oups.com...

Quote:

Originally Posted by

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 <bodysection 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:

Quote:

Originally Posted by

>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
>>
>--
>I hope this helps,
>Steve C. Orr, MCSD, MVP
>http://SteveOrr.net
>>
>>
><nashak@.hotmail.comwrote in message
>news:1156454777.016791.137500@.m73g2000cwd.googlegr oups.com...

Quote:

Originally Posted by

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,tool bar=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
>


>


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

Steve C. Orr [MVP, MCSD] wrote:

Quote:

Originally Posted by

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 hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
>
>
<nashak@.hotmail.comwrote in message
news:1156467190.273771.261480@.h48g2000cwc.googlegr oups.com...

Quote:

Originally Posted by

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 <bodysection 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:

Quote:

Originally Posted by

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
>
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
>
>
<nashak@.hotmail.comwrote in message
news:1156454777.016791.137500@.m73g2000cwd.googlegr oups.com...
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,tool bar=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



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
<nashak@.hotmail.comwrote in message
news:1156519615.749339.73440@.p79g2000cwp.googlegro ups.com...

Quote:

Originally Posted by

thanks, but i cannot use that control. I need to build this
functionality.
>
>
>
Steve C. Orr [MVP, MCSD] wrote:

Quote:

Originally Posted by

>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 hope this helps,
>Steve C. Orr, MCSD, MVP
>http://SteveOrr.net
>>
>>
><nashak@.hotmail.comwrote in message
>news:1156467190.273771.261480@.h48g2000cwc.googlegr oups.com...

Quote:

Originally Posted by

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 <bodysection 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
>>
>--
>I hope this helps,
>Steve C. Orr, MCSD, MVP
>http://SteveOrr.net
>>
>>
><nashak@.hotmail.comwrote in message
>news:1156454777.016791.137500@.m73g2000cwd.googlegr oups.com...
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,tool bar=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
>
>


>

0 comments:

Post a Comment