By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,182 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Using asp:HyperLink to open a new window

P: n/a
Hello,

I am using asp:HyperLink in a c# asp.net application to open a new window in
the following way:

<asp:HyperLink ID="lnkSiteName" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.name") %>'
NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval
(Container.DataItem,"id").ToString()%>' Target="_blank">
</asp:HyperLink>

The window opens just fine with the parameter (id) i have sent.

The only thing i need is to set the window's properties -
"toolbar=yes;status=no;location=no;menubar=no;widt h=280,height=520..."

How can i set those properties?

Thanks,
Dana
Apr 18 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a

P: n/a

"dana lees" <da***@idc.ac.il> wrote in message
news:OF**************@TK2MSFTNGP04.phx.gbl...
Hello,

I am using asp:HyperLink in a c# asp.net application to open a new window in the following way:

<asp:HyperLink ID="lnkSiteName" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.name") %>'
NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval
(Container.DataItem,"id").ToString()%>' Target="_blank">
</asp:HyperLink>

The window opens just fine with the parameter (id) i have sent.

The only thing i need is to set the window's properties -
"toolbar=yes;status=no;location=no;menubar=no;widt h=280,height=520..."

How can i set those properties?

Thanks,
Dana

You can add .. name="yourwindowname"
onclick="yourwindowname=window.open('','yourwindow name','resizable=no,scroll
bars=yes,status=no,toolbar=yes,height=500,width=70 0,left=50,top=40');yourwin
downame.focus();return true;" .... somewhere inside the asp:hyperlnk tags
Apr 18 '06 #3

P: n/a

"newsgroups.comcast.net" <Mi****************@noZorY.geZwaYrrenY.com> wrote
in message news:dK******************************@comcast.com. ..

"dana lees" <da***@idc.ac.il> wrote in message
news:OF**************@TK2MSFTNGP04.phx.gbl...
Hello,

I am using asp:HyperLink in a c# asp.net application to open a new
window in
the following way:

<asp:HyperLink ID="lnkSiteName" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.name") %>'
NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval
(Container.DataItem,"id").ToString()%>' Target="_blank">
</asp:HyperLink>

The window opens just fine with the parameter (id) i have sent.

The only thing i need is to set the window's properties -
"toolbar=yes;status=no;location=no;menubar=no;widt h=280,height=520..."

How can i set those properties?

Thanks,
Dana
You can add .. name="yourwindowname"

onclick="yourwindowname=window.open('','yourwindow name','resizable=no,scroll bars=yes,status=no,toolbar=yes,height=500,width=70 0,left=50,top=40');yourwin downame.focus();return true;" .... somewhere inside the asp:hyperlnk

tags

Forget to say that you should change target="yourwindowname"
Mike
Apr 18 '06 #4

P: n/a

"newsgroups.comcast.net" <Mi****************@noZorY.geZwaYrrenY.com> wrote
in message news:dK******************************@comcast.com. ..

"dana lees" <da***@idc.ac.il> wrote in message
news:OF**************@TK2MSFTNGP04.phx.gbl...
Hello,

I am using asp:HyperLink in a c# asp.net application to open a new
window in
the following way:

<asp:HyperLink ID="lnkSiteName" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.name") %>'
NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval
(Container.DataItem,"id").ToString()%>' Target="_blank">
</asp:HyperLink>

The window opens just fine with the parameter (id) i have sent.

The only thing i need is to set the window's properties -
"toolbar=yes;status=no;location=no;menubar=no;widt h=280,height=520..."

How can i set those properties?

Thanks,
Dana
You can add .. name="yourwindowname"

onclick="yourwindowname=window.open('','yourwindow name','resizable=no,scroll bars=yes,status=no,toolbar=yes,height=500,width=70 0,left=50,top=40');yourwin downame.focus();return true;" .... somewhere inside the asp:hyperlnk tags

One other point. the '' after window.open( is 2 single quotes, not a double
quote
Apr 18 '06 #5

P: n/a

"vMike" <Mi****************@noZorY.geZwaYrrenY.com> wrote in message
news:QM********************@comcast.com...

"newsgroups.comcast.net" <Mi****************@noZorY.geZwaYrrenY.com> wrote
in message news:dK******************************@comcast.com. ..

"dana lees" <da***@idc.ac.il> wrote in message
news:OF**************@TK2MSFTNGP04.phx.gbl...
Hello,

I am using asp:HyperLink in a c# asp.net application to open a new window
in
the following way:

<asp:HyperLink ID="lnkSiteName" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.name") %>'
NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval
(Container.DataItem,"id").ToString()%>' Target="_blank">
</asp:HyperLink>

The window opens just fine with the parameter (id) i have sent.

The only thing i need is to set the window's properties -
"toolbar=yes;status=no;location=no;menubar=no;widt h=280,height=520..."

How can i set those properties?

Thanks,
Dana
You can add .. name="yourwindowname"

onclick="yourwindowname=window.open('','yourwindow name','resizable=no,scroll

bars=yes,status=no,toolbar=yes,height=500,width=70 0,left=50,top=40');yourwin
downame.focus();return true;" .... somewhere inside the asp:hyperlnk

tags

One other point. the '' after window.open( is 2 single quotes, not a

double quote

oops having a bad day I guess the onclick should read
onclick="somename=window.open('','yourwindowname', 'resizable=no,scroll
bars=yes,status=no,toolbar=yes,height=500,width=70 0,left=50,top=40');somenam
e.focus();return true;"

sorry
Apr 18 '06 #6

P: n/a
There is no "onClick" event to the "asp:HyperLink" control...
"newsgroups.comcast.net" <Mi****************@noZorY.geZwaYrrenY.com> wrote
in message news:dK******************************@comcast.com. ..

"dana lees" <da***@idc.ac.il> wrote in message
news:OF**************@TK2MSFTNGP04.phx.gbl...
Hello,

I am using asp:HyperLink in a c# asp.net application to open a new
window in
the following way:

<asp:HyperLink ID="lnkSiteName" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.name") %>'
NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval
(Container.DataItem,"id").ToString()%>' Target="_blank">
</asp:HyperLink>

The window opens just fine with the parameter (id) i have sent.

The only thing i need is to set the window's properties -
"toolbar=yes;status=no;location=no;menubar=no;widt h=280,height=520..."

How can i set those properties?

Thanks,
Dana
You can add .. name="yourwindowname"

onclick="yourwindowname=window.open('','yourwindow name','resizable=no,scroll bars=yes,status=no,toolbar=yes,height=500,width=70 0,left=50,top=40');yourwin downame.focus();return true;" .... somewhere inside the asp:hyperlnk tags

Apr 20 '06 #7

P: n/a
Does this work:
HyperLink hl = new HyperLink();
hl.Target = "_blank";

?

"dana lees" <da***@idc.ac.il> wrote in message
news:OB**************@TK2MSFTNGP04.phx.gbl...
There is no "onClick" event to the "asp:HyperLink" control...
"newsgroups.comcast.net" <Mi****************@noZorY.geZwaYrrenY.com> wrote
in message news:dK******************************@comcast.com. ..

"dana lees" <da***@idc.ac.il> wrote in message
news:OF**************@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I am using asp:HyperLink in a c# asp.net application to open a new

window
in
> the following way:
>
> <asp:HyperLink ID="lnkSiteName" runat="server" Text='<%#
> DataBinder.Eval(Container, "DataItem.name") %>'
> NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval
> (Container.DataItem,"id").ToString()%>' Target="_blank">
> </asp:HyperLink>
>
> The window opens just fine with the parameter (id) i have sent.
>
> The only thing i need is to set the window's properties -
> "toolbar=yes;status=no;location=no;menubar=no;widt h=280,height=520..."
>
> How can i set those properties?
>
> Thanks,
> Dana
>

You can add .. name="yourwindowname"

onclick="yourwindowname=window.open('','yourwindow name','resizable=no,scroll

bars=yes,status=no,toolbar=yes,height=500,width=70 0,left=50,top=40');yourwin
downame.focus();return true;" .... somewhere inside the asp:hyperlnk

tags


Apr 20 '06 #8

P: n/a

"dana lees" <da***@idc.ac.il> wrote in message
news:OB**************@TK2MSFTNGP04.phx.gbl...
There is no "onClick" event to the "asp:HyperLink" control...
"newsgroups.comcast.net" <Mi****************@noZorY.geZwaYrrenY.com> wrote
in message news:dK******************************@comcast.com. ..

"dana lees" <da***@idc.ac.il> wrote in message
news:OF**************@TK2MSFTNGP04.phx.gbl...
Hello,

I am using asp:HyperLink in a c# asp.net application to open a new window
in
the following way:

<asp:HyperLink ID="lnkSiteName" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.name") %>'
NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval
(Container.DataItem,"id").ToString()%>' Target="_blank">
</asp:HyperLink>

The window opens just fine with the parameter (id) i have sent.

The only thing i need is to set the window's properties -
"toolbar=yes;status=no;location=no;menubar=no;widt h=280,height=520..."

How can i set those properties?

Thanks,
Dana

You can add .. name="yourwindowname"

onclick="yourwindowname=window.open('','yourwindow name','resizable=no,scroll

bars=yes,status=no,toolbar=yes,height=500,width=70 0,left=50,top=40');yourwin
downame.focus();return true;" .... somewhere inside the asp:hyperlnk

tags

yes but there is an onclick event in html. It just adds a client script to
do the job. you can add not asp events to asp controls too.
Apr 20 '06 #9

P: n/a

"dana lees" <da***@idc.ac.il> wrote in message
news:OB**************@TK2MSFTNGP04.phx.gbl...
There is no "onClick" event to the "asp:HyperLink" control...
"newsgroups.comcast.net" <Mi****************@noZorY.geZwaYrrenY.com> wrote
in message news:dK******************************@comcast.com. ..


Try putting this in a aspx file an run it (you may need to fix any wrapping)

<%@ Page %>

<html>
<head>
</head>
<body>
<asp:hyperlink id="zoom1"

onclick="vlarge1=window.open('','vlarge','resizabl e=no,scrollbars=yes,status
=no,toolbar=no,height=500,width=700,left=50,top=40 ');vlarge1.focus();return
true;"
onmouseover="window.status='Click here for high quality
picture.';return true"
onmouseout="window.status=''; return true;"
text="View large image"

imageurl="http://us.i1.yimg.com/us.yimg.com/i/ww/bt1/125.gif"
navigateurl = "http://google.com"
target="vlarge"
runat="server"/>
</body>
</html>
Mike
Apr 20 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.