Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / August 2006

Tip: Looking for answers? Try searching our database.

Problem: Open new browser window

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nashak@hotmail.com - 25 Aug 2006 01:54 GMT
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,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?
UsualDosage - 30 Aug 2006 21:38 GMT
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.

Signature

"Quae narravi, nullo modo negabo."

> Hello,
>
[quoted text clipped - 29 lines]
> One way I was told is using onload function. Would appreciate is
> someone could provide some more details on how to do this?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.