Thursday, March 29, 2012

Pop Up Window Name - Would like it to be timestamp

Hi,

I'm an asp programmer currently in the low process of converting one of my asp intranets into asp.net (vb).

This is going to be one of many questions i ask on the forum (glad I've found it) !

I have a link a page that opens up popup window (removes all the buttons from the nav bar, chromless effect).

I would normally do the following at the top of the page:

<script language=javascript runat=server>
function GetTimeInMillisec()
{
var Now = new Date()
var TimeStamp = Now.getTime()

return TimeStamp
}
</script>
<%
varTimeStamp = GetTimeInMillisec()
%
Then the link would be:

<a href="http://links.10026.com/?link=javascript:launchwin('frameset.asp','<%=varTimeStamp%>','width='+(screen.width-11)+',height='+(screen.height-92)+',screenX=0,screenY=0,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,status=1,toolbar=0,top=0,left=0,resizable=yes')">Open</a
Can someone give me some pointers on how I am able pass a timestamp value (or another random character string) into the name of the window.

The reason I want this is in case a user wants to be able to have multiple instances of the system open.

Thank you
James Campbell

I take it you have a js function called launchwin? If so can you not set it there? If you want to use a .net datetime when the page was created use <%=DateTime.Now%>

There's few options depending on what your requirements are..


Hi,

Yes I have a js function called launchwin. Reading your post just makes me think that I am thinking too hard about a very simple problem !

Thanks for the nudge in the right direction.

James


To complete this thread I now have:

<a href="http://links.10026.com/?link=javascript:launchwin('System/Login.aspx','<%=DateTime.Now.toString("mmssffffff")%>','width='+(screen.width-11)+',height='+(screen.height-92)+',screenX=0,screenY=0,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,status=1,toolbar=0,top=0,left=0,resizable=yes')">Launch</a
Thanks jibber !

James

Pop Up Window with Server.Transfer

Hi,

In one of my asp.net page, when users click on a button, I am using Server.Transfer to redirect user to another page and pass all the info to that page asServer.Transfer("TripDetails.aspx").

I need to open a new window and pass all the info to new page. How can I achive this? How can I open a new window and useServer.Transfer at the same time?

Thanks

On the click event of the button you'll need to open a new window there using javascript like window.open. If the button is submitting a form you can set the TARGET of the FORM to be _blank;

<FORM target="_blank" action="...">


Thanks Aidy, it works for me.

pop up window using javascript

hi how can I open this link in new pop up window using javascript?
<asp:HyperLink id="HLink_Amex" runat="server" NavigateUrl="images/cvv_amex.g
if">Amex?</asp:HyperLink>
mahsamahsa,
Try set Target=_blank
Thomas Andersson
"mahsa" wrote:

> hi how can I open this link in new pop up window using javascript?
> <asp:HyperLink id="HLink_Amex" runat="server" NavigateUrl="images/cvv_amex
.gif">Amex?</asp:HyperLink>
> --
> mahsa
And if you're not generating the URL or the HyperLink control dynamically in
code, you might be better off using a standard HTML Anchor as in
<A href="http://links.10026.com/?link=images/cvv_amex.gif" target="_blank">Amex?</A>
Why have a runat="server" when the server isn't adding anything to the
picture? It's a waste of server resources.
Dale Preston
MCAD, MCSE, MCDBA
"crexes" <crexes@.discussions.microsoft.com> wrote in message
news:902C6D44-D451-411B-A69B-50C1C2DE30FF@.microsoft.com...
> mahsa,
> Try set Target=_blank
> Thomas Andersson
> "mahsa" wrote:
>
NavigateUrl="images/cvv_amex.gif">Amex?</asp:HyperLink>

pop up window using javascript

hi how can I open this link in new pop up window using javascript?
<asp:HyperLink id="HLink_Amex" runat="server" NavigateUrl="images/cvv_amex.gif">Amex?</asp:HyperLink
--
mahsamahsa,

Try set Target=_blank

Thomas Andersson

"mahsa" wrote:

> hi how can I open this link in new pop up window using javascript?
> <asp:HyperLink id="HLink_Amex" runat="server" NavigateUrl="images/cvv_amex.gif">Amex?</asp:HyperLink>
> --
> mahsa
And if you're not generating the URL or the HyperLink control dynamically in
code, you might be better off using a standard HTML Anchor as in

<A href="http://links.10026.com/?link=images/cvv_amex.gif" target="_blank">Amex?</A
Why have a runat="server" when the server isn't adding anything to the
picture? It's a waste of server resources.

Dale Preston
MCAD, MCSE, MCDBA

"crexes" <crexes@.discussions.microsoft.com> wrote in message
news:902C6D44-D451-411B-A69B-50C1C2DE30FF@.microsoft.com...
> mahsa,
> Try set Target=_blank
> Thomas Andersson
> "mahsa" wrote:
> > hi how can I open this link in new pop up window using javascript?
> > <asp:HyperLink id="HLink_Amex" runat="server"
NavigateUrl="images/cvv_amex.gif">Amex?</asp:HyperLink>
> > --
> > mahsa

Pop Up windows

Hello,
What is the best approach to bringing up pop-up windows to verify a users
request. (i.e. - "Are you sure you want to delete? yes no)
I know how to bring the window up in javascript...but once the user click
"yes" in the new pop-up window, I need to somehow invoke a delete call in
the c# code behind of the original page.
Any help would be appreciated.
Thanks.Using either a Button or LinkButton control, you can add the "onclick"
attribute to it and place the javascript code in there.
For example:
lnkCancel.Attributes.Add("onclick", "return window.confirm('Are you sure
you want to cancel this order?');");
If the user clicks OK, the button will submit and the appropriate
code-behind for the button will be executed. If the user clicks cancel,
then the form will not submit.
Ben Lucas
Lead Developer
Solien Technology, Inc.
www.solien.com
"Bilbo" <Bilbo@.cox.net> wrote in message
news:OcSpUe6iEHA.3876@.TK2MSFTNGP15.phx.gbl...
> Hello,
> What is the best approach to bringing up pop-up windows to verify a users
> request. (i.e. - "Are you sure you want to delete? yes no)
> I know how to bring the window up in javascript...but once the user click
> "yes" in the new pop-up window, I need to somehow invoke a delete call in
> the c# code behind of the original page.
> Any help would be appreciated.
> Thanks.
>

Pop Up windows

Hello,

What is the best approach to bringing up pop-up windows to verify a users
request. (i.e. - "Are you sure you want to delete? yes no)

I know how to bring the window up in javascript...but once the user click
"yes" in the new pop-up window, I need to somehow invoke a delete call in
the c# code behind of the original page.

Any help would be appreciated.

Thanks.Using either a Button or LinkButton control, you can add the "onclick"
attribute to it and place the javascript code in there.

For example:

lnkCancel.Attributes.Add("onclick", "return window.confirm('Are you sure
you want to cancel this order?');");

If the user clicks OK, the button will submit and the appropriate
code-behind for the button will be executed. If the user clicks cancel,
then the form will not submit.

--
Ben Lucas
Lead Developer
Solien Technology, Inc.
www.solien.com

"Bilbo" <Bilbo@.cox.net> wrote in message
news:OcSpUe6iEHA.3876@.TK2MSFTNGP15.phx.gbl...
> Hello,
> What is the best approach to bringing up pop-up windows to verify a users
> request. (i.e. - "Are you sure you want to delete? yes no)
> I know how to bring the window up in javascript...but once the user click
> "yes" in the new pop-up window, I need to somehow invoke a delete call in
> the c# code behind of the original page.
> Any help would be appreciated.
> Thanks.

Pop up windows

Hi,

How to make pop up window from code behine without using
java script. And another thing is that, how to pass value
from the pop up window to a form if there is a textbox in
the pop up. ThanksMaking popup windows is a client task and as such it can be done only with
client tools. The only way to create a popup is javascript showModalDialog
call.

You can pass a value back from popup in window.returnValue property. The
javascript showModalDialog statement that started the popup will get this
value as a result of the call.

Eliyahu

"Souljaz" <Souljaz@.discussions.microsoft.com> wrote in message
news:1ddd01c52de9$9e89fb80$a401280a@.phx.gbl...
> Hi,
> How to make pop up window from code behine without using
> java script. And another thing is that, how to pass value
> from the pop up window to a form if there is a textbox in
> the pop up. Thanks