473,395 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using asp:HyperLink to open a new window

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
9 28010

"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

"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

"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

"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
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
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

"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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Thubaiti | last post by:
Hi, I have this code: <td> <a href="#" class="toolbar">Computers</a> <a href="commun.html" class="toolbar">Communications</a> <a href="electronics.html" class="toolbar">Electronics</a> <a...
0
by: Kevin Quigley | last post by:
Hi, I have a datalist which has an EditItemTemplate section, within this I have a hyperlink control with which I want to open a new window with some help details. This is the hyperlink code:...
4
by: Amir Eshterayeh | last post by:
Dear Friends My asp hyperlink goes to relative address instead of absolute. I like navigate url goes to outsite link like www.asp.net but now, it goes to www.mysite/www.asp.net please help....
4
by: James P. | last post by:
Hello there, I have an asp hyperlink in a template page. In my user control page - code behind page that uses the template, I'd like to turn this link invisible in certain case. Is it...
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
9
by: Leon | last post by:
What Am I Doing Wrong? Code Will Not Run, I Can't See The Error! Thanks. <asp:datalist id="DataList1" runat="server" RepeatColumns="4"> <ItemTemplate> <asp:HyperLink id=HyperLink1 ImageUrl=...
4
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile"...
1
by: Nathan Sokalski | last post by:
I am using the ImageUrl property of the Hyperlink control to create a graphical Hyperlink. However, I want to change the size of the image I am using, but the generated HTML places the width/height...
2
by: BobLaughland | last post by:
Hi There, I need a control on my site that is a hyperlink style control, but it must, 1) Have a property that can hold where the hyperlink is pointing to. (e.g. like the NavigateUrl property...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.