Showing posts with label window. Show all posts
Showing posts with label window. Show all posts

Thursday, March 22, 2012

Taking a value from one window to another

I want to be able to allow a user to select a word from a list of words, but instead of using a drop down list, I want the user to click a button - which opens a new window containing the list of words, double click on the word (or words) selected, and the value of the word that was double clicked is automatically transferred to a text box in the previous (calling) window. Is this possible in ASP.NET?Passing data back to a parent window is entirely possible via lowly javascript - with or without ASP.NET server technology, but the user interaction method you have decided upon would be a little more unstable across browsers.
window.opener.document.getElementById('textbox1').value = "something";

Tuesday, March 13, 2012

target size

I know how to use javascript to open a hyperlink in a resized window without
toolbars. But would it be better to do so from the code behind pages and if
so, how? which classes? Thanks

Buzother than the code behind setting the url for hyperlink, you got it.

-- bruce (sqlwork.com)

"Buz Waitz" <bwaitz@.sbcglobal.net> wrote in message
news:O3hohLmUEHA.716@.TK2MSFTNGP11.phx.gbl...
> I know how to use javascript to open a hyperlink in a resized window
without
> toolbars. But would it be better to do so from the code behind pages and
if
> so, how? which classes? Thanks
> Buz
>I know how to use javascript to open a hyperlink in a resized window without
>toolbars. But would it be better to do so from the code behind pages and if
>so, how? which classes? Thanks
>Buz

I am pretty sure u need to use javascript, but if u want to call the
javascript from the codebehind try this:

this.RegisterClientScriptBlock("","insertscripthere");

-Adam
client script blocks will not work with xp service pack 2 for this
application. in code behind you can only set the javascript url of the
hyperlink.

-- bruce (sqlwork.com)

<ashelley@.inlandkwpp.com> wrote in message
news:h1fsc090oq4j60kn9lt5rdsicmupjii3a9@.4ax.com...
> >I know how to use javascript to open a hyperlink in a resized window
without
> >toolbars. But would it be better to do so from the code behind pages and
if
> >so, how? which classes? Thanks
> >Buz
> I am pretty sure u need to use javascript, but if u want to call the
> javascript from the codebehind try this:
> this.RegisterClientScriptBlock("","insertscripthere");
> -Adam
On Tue, 15 Jun 2004 11:01:30 -0700, "bruce barker"
<nospam_brubar@.safeco.com> wrote:

>client script blocks will not work with xp service pack 2 for this
>application. in code behind you can only set the javascript url of the
>hyperlink.
>-- bruce (sqlwork.com)

interesting.

function popUp(wUrl,wName,wOpts)
{
//x y are set to current cursor location already
var newWindow;
newWindow = window.open('',wName,wOpts);
if(newWindow)
{

newWindow.document.write('<body><center>wait...</center></body>');
newWindow.document.close();
newWindow.moveTo(x,y);
newWindow.focus();
newWindow.location = wUrl;
}
}

and call

this.RegisterClientScriptBlock("","<script
language='javascript'>popUp('someurl','windowname','someoptions');</script>");

this won't work with xp sp 2?

-Adam

target size

I know how to use javascript to open a hyperlink in a resized window without
toolbars. But would it be better to do so from the code behind pages and if
so, how? which classes? Thanks
Buzother than the code behind setting the url for hyperlink, you got it.
-- bruce (sqlwork.com)
"Buz Waitz" <bwaitz@.sbcglobal.net> wrote in message
news:O3hohLmUEHA.716@.TK2MSFTNGP11.phx.gbl...
> I know how to use javascript to open a hyperlink in a resized window
without
> toolbars. But would it be better to do so from the code behind pages and
if
> so, how? which classes? Thanks
> Buz
>
>I know how to use javascript to open a hyperlink in a resized window without
>toolbars. But would it be better to do so from the code behind pages and if
>so, how? which classes? Thanks
>Buz
>
I am pretty sure u need to use javascript, but if u want to call the
javascript from the codebehind try this:
this.RegisterClientScriptBlock("","insertscripthere");
-Adam
client script blocks will not work with xp service pack 2 for this
application. in code behind you can only set the javascript url of the
hyperlink.
-- bruce (sqlwork.com)
<ashelley@.inlandkwpp.com> wrote in message
news:h1fsc090oq4j60kn9lt5rdsicmupjii3a9@.
4ax.com...
without
if
> I am pretty sure u need to use javascript, but if u want to call the
> javascript from the codebehind try this:
> this.RegisterClientScriptBlock("","insertscripthere");
> -Adam
On Tue, 15 Jun 2004 11:01:30 -0700, "bruce barker"
<nospam_brubar@.safeco.com> wrote:

>client script blocks will not work with xp service pack 2 for this
>application. in code behind you can only set the javascript url of the
>hyperlink.
>-- bruce (sqlwork.com)
>
interesting.
function popUp(wUrl,wName,wOpts)
{
//x y are set to current cursor location already
var newWindow;
newWindow = window.open('',wName,wOpts);
if(newWindow)
{
newWindow.document.write('<body><center>wait...</center></body>');
newWindow.document.close();
newWindow.moveTo(x,y);
newWindow.focus();
newWindow.location = wUrl;
}
}
and call
this.RegisterClientScriptBlock("","<script
language='javascript'> popUp('someurl','windowname','someoption
s');</script>"
);
this won't work with xp sp 2?
-Adam

Target Window question

Im trying to target="top" when the user click on the login button - But its not working for me, any ideas where i put Target="top" sorry im new to .aspx

cheers

ZOIK

Example of code.

<asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderPadding="4"
BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="Small"
ForeColor="#333333" Height="147px" Width="293px" DestinationPageUrl="~/secure_industry/Default.aspx">
<TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" />
<InstructionTextStyle Font-Italic="True" Font-Size="Small" ForeColor="Black" />
<TextBoxStyle Font-Size="X-Small" />
<LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px"
Font-Names="Verdana" Font-Size="Small" ForeColor="#284775"/>
<LabelStyle Font-Size="Small" />
<CheckBoxStyle Font-Size="Small" />
<HyperLinkStyle Font-Size="Small" />
</asp:Login>

Hi,

I think it is not possible to do that with the inbuilt login control. What you can do is create a login template with the code from the below link and then set the onclick event of the button control to target="_top"

http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/ctrlref/login/LoginTemplate.src

Let me know if you have any issues.


Thanks mate thats excellent.