all groups > dotnet jscript > march 2004 >
You're in the

dotnet jscript

group:

Using JavaScript and Response.Redirect


Re: Using JavaScript and Response.Redirect bruce barker
3/26/2004 9:05:20 AM
dotnet jscript:
no, for several reasons.

1) there is no CreateWnd function in javascript, you might want to look at
window.open().
2) using the redirect would leave the current window displaying [object]
3) while you could code it:

<script>window.open('somefile.aspx','_blank');</script>

which you can find examples on this newsgroup, I don't recommend it because
pop blockers, including the next security release for IE will prevent it
from working.


popup windows should only be opened by client script while inside a onclick
event.


-- bruce (sqlwork.com)



[quoted text, click to view]

Using JavaScript and Response.Redirect ruca
3/26/2004 11:22:58 AM
I have a .JS file that opens a popup window.


Here is the question...

I have a DataGrid with a select command that in this case, when I choose
"Select", I want to open my popup window.
The question is if I can do something like this in the function that is the
target of select command of datagrid:

Response.Redirect("javascript:CreateWnd('somefile.aspx', 600, 200, false);")

Or what is the solution for that?


--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca


Re: Using JavaScript and Response.Redirect bruce barker
3/29/2004 9:01:51 AM
well, client code only runs in the browser, so you have to send back html
that includes the script command. in the code behind you use
RegisterClientScriptBlock, but this just add the js call to the output
stream. the HTTP protocol does not support server to client calls.


-- bruce (sqlwork.com)





[quoted text, click to view]

Re: Using JavaScript and Response.Redirect ruca
3/29/2004 10:42:08 AM
I don't think that you understand what I'm trying to said.
I know that don't exist any CreateWnd (...) function in javascript. This
function it is mine and it's included in my .JS file that I talk in previous
e-mail.
Now.... what I want to know it's if there is anyway to call one function of
javasrcipt in my code source and not in HTML source.

Hope this helps you to understant what I mean.


--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"bruce barker" <nospam_brubar@safeco.com> escreveu na mensagem
news:%23liYGS1EEHA.2976@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button