|
-
Jan 2nd, 2011, 04:15 PM
#1
Thread Starter
Addicted Member
What is the problem in it?
Hi I'm using following code
Code:
Dim newWin As String = ("<script language='javascript'>" + "window.open('successMess.aspx' , 'Print', 'height=200, width=220, menubar=no, toolbar=no, scrollbars=no, resizable=no'); </script>")
ClientScript.RegisterStartupScript(Me.GetType(), "pop", newWin)
Response.Redirect(MyPanel.aspx", False)
Windows.open runs perfectly when I remore response.redirect statement and doesn't works when I add it. What could b the problem. I'm not getting.
Thanx
-
Jan 2nd, 2011, 04:47 PM
#2
Re: What is the problem in it?
Hey,
This is because the Response is being redirected, as a result the JavaScript is never being injected onto the page.
Gary
-
Jan 2nd, 2011, 04:59 PM
#3
Thread Starter
Addicted Member
Re: What is the problem in it?
-
Jan 2nd, 2011, 05:01 PM
#4
Re: What is the problem in it?
Hey,
Rather than using the Response.Redirect, since you are already injecting JavaScript, use JavaScript to change the current page, i.e use window.location = "<your url here>";
Gary
-
Jan 2nd, 2011, 05:35 PM
#5
Thread Starter
Addicted Member
Re: What is the problem in it?
 Originally Posted by gep13
Hey,
Rather than using the Response.Redirect, since you are already injecting JavaScript, use JavaScript to change the current page, i.e use window.location = "<your url here>";
Gary
Code:
Dim newWin As String = ("<script language='javascript'>" + "window.open('successMess.aspx' , 'Print', 'height=200, width=220, menubar=no, toolbar=no, scrollbars=no, resizable=no'); </script>")
ClientScript.RegisterStartupScript(Me.GetType(), "pop", newWin)
Dim cstype As Type = Me.[GetType]()
Dim cs As ClientScriptManager = Page.ClientScript
cs.RegisterStartupScript(cstype, "dateSrpt", "<script>window.location='cpanel/MyPanel.aspx'</script>")
Not working. Can u help with little code
-
Jan 2nd, 2011, 05:44 PM
#6
Thread Starter
Addicted Member
Re: What is the problem in it?
 Originally Posted by ravininave
Code:
Dim newWin As String = ("<script language='javascript'>" + "window.open('successMess.aspx' , 'Print', 'height=200, width=220, menubar=no, toolbar=no, scrollbars=no, resizable=no'); </script>")
ClientScript.RegisterStartupScript(Me.GetType(), "pop", newWin)
Dim cstype As Type = Me.[GetType]()
Dim cs As ClientScriptManager = Page.ClientScript
cs.RegisterStartupScript(cstype, "dateSrpt", "<script>window.location='cpanel/MyPanel.aspx'</script>")
Not working. Can u help with little code
I feel problem in this line
Code:
cs.RegisterStartupScript(cstype, "dateSrpt", "<script>window.location='cpanel/MyPanel.aspx'</script>")
My .aspx form is in inner cpanel folder. If I write ~/cpanel/MyPanel.aspx it still not working.
-
Jan 2nd, 2011, 06:01 PM
#7
Re: What is the problem in it?
The ~ is rendered by the ASP.Net engine, and won't work on the client.
When it opens in the browser, what URL is it trying to open?
Gary
-
Jan 2nd, 2011, 06:11 PM
#8
Thread Starter
Addicted Member
Re: What is the problem in it?
 Originally Posted by gep13
The ~ is rendered by the ASP.Net engine, and won't work on the client.
When it opens in the browser, what URL is it trying to open?
Gary
site/~/cpanel/MyPanel.aspx
if I try only 'cpanel/MyPanel.aspx' then it doesn't works.
'/cpanel/MyPanel.aspx' this also doesn't works.
-
Jan 2nd, 2011, 07:10 PM
#9
Re: What is the problem in it?
What if you try using the complete absolute url?
Gary
-
Jan 2nd, 2011, 08:09 PM
#10
Re: What is the problem in it?
I have I got this right.
Your opening a popup window and that is working
Your trying to redirect the Parient window to another page as well and that is not working
Is that right?
The problem with computers is their nature is pure logic. Just once I'd like my computer to do something deluded. 
-
Jan 3rd, 2011, 12:17 AM
#11
Thread Starter
Addicted Member
Re: What is the problem in it?
 Originally Posted by brin351
I have I got this right.
Your opening a popup window and that is working
Your trying to redirect the Parient window to another page as well and that is not working
Is that right?
Yes, I think that there is some syntax error.
-
Jan 3rd, 2011, 05:24 AM
#12
Re: What is the problem in it?
No syntax error the path to your page is invalid. Try what Gary suggested - absolute url
window.location='/cpanel/MyPanel.aspx'
asuming "cpanel" is a folder under the website root directory
The problem with computers is their nature is pure logic. Just once I'd like my computer to do something deluded. 
-
Jan 3rd, 2011, 07:56 AM
#13
Re: What is the problem in it?
When it tries to open the page (assuming IE) right click on the page, and go to properties. What is the exact url that it is trying to open.
Gary
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
|
Click Here to Expand Forum to Full Width
|