-
passing parameters while opening a new window
Hey
I'm quite new in developing and I'm having some problems with passing url parameters.
I'm writing in vb.net (asp.net) and usually when creating an event, I'm using this:
dim paramName as string
paramName = request.querystring("CODE")....
...btn_onclick ()...
response.redirect("1.aspx?code=" & paramName)
The problem is that now I need to do the same, but open the new page in a new window.
I understand that I need to use window.open() and write some javascript
(I thought at first that I need target="_blank")
Since I'm not that familiar with javascript I don't really understand how to pass a parameter from the previous page to the new one

Thanks,
D.
-
window.open
hi there,
i use this function:
//beginning of javascript function
function openWindow(aName,aMode,anID,aService,h,w,TableSize) {
var vUrl= "<an url>?aName=" + aName + "&aMode=" + aMode + "&anID=" + anID + "&aService=" + aService + "&H=" + h + "&W=" + w + "&TableSize=" + TableSize;
var vWindow = window.open("", "vWindow", "width=" + w + ",height=" + h + ",menubar=no,toolbar=no,status=no,personalbar=no,resizable=yes,scrollbars=no");
if (vWindow == null)
{
alert("Please disable pop-up blockers");
}
vWindow.focus();
vWindow.location=vUrl;
vWindow.moveTo(0, 0);
}
//end of javascript function
then in vb.net in a code-behind page of an aspx file, I have somewhere:
'beginning of vb.net code
sb.Append("<td align=""center""><a href=""vWindow"" onclick=""")
sb.Append("openWindow('") 'and so forth
'end of vb.net code
which creates dynamic html. thus, when somebody clicks such link it opens a pop-up window.
now, i know you want something different, which is to redirect to 1.aspx in a pop-up window. well, i haven't done that, but maybe this will work (you just have to let us know...)
instead of:
response.redirect("1.aspx?code=" & paramName)
change to:
response.write("<script language='javascript'>return openWindow(" + <send parameters as string values> + ";</script>")
and inside openWindow, <an url> would be "1.aspx"
maybe, this is that simple, or needs more work to be done.
i wish you luck,
tonci korsano
Similar Threads
-
By careys in forum ASP.NET
Replies: 13
Last Post: 05-31-2011, 07:11 AM
-
By ak_siva in forum ASP.NET
Replies: 1
Last Post: 12-24-2007, 12:30 AM
-
By Usha.R in forum ASP.NET
Replies: 1
Last Post: 02-14-2006, 03:30 AM
-
Replies: 0
Last Post: 06-04-2001, 10:17 AM
-
By TC in forum VB Classic
Replies: 8
Last Post: 09-26-2000, 02:34 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|