473,406 Members | 2,849 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,406 software developers and data experts.

Buttons Opens a new window

I am wondering what the best way to have a button on a webform open in a new
browser window. I have a webform with a ComponentOne report on it, and I
want to export to excel, but when they click the export button I want it to
open in a new window. I know I could do it in client side javaacsript, and
pass in all the appropriate parameters, but it seems like there should be a
better way. Any ideas?

Thanks,
Mark Richards
Nov 18 '05 #1
4 923
to open a new window you will have to resort to javascript if you want to
use button... (that to htmlcontrol)

you other option is Hyperlink but that translates to <a href=""> on client..
you can set the url to go using naviateurl and the target like open in a new
window etc...

hth

--
Regards,

HD

"netnews.comcast.net" <Ma**@InterDataSoft.com> wrote in message
news:gAgMb.26664$xy6.66982@attbi_s02...
I am wondering what the best way to have a button on a webform open in a new browser window. I have a webform with a ComponentOne report on it, and I
want to export to excel, but when they click the export button I want it to open in a new window. I know I could do it in client side javaacsript, and pass in all the appropriate parameters, but it seems like there should be a better way. Any ideas?

Thanks,
Mark Richards

Nov 18 '05 #2

Hi Mark,

Thanks for posting in this group.
Actually, the .Net asp.net mechanism only encapsulates the client side html
code and javascript. So all the works will be eventually get done throught
javascript code or html tag.
For your open a new window issue, .Net class library does not encapsulate a
way to open a new window, so I think you need refer to window.open
javascript method.
If you want to get this done at server side runtime, I think you can use
Page.RegisterClientScriptBlock method to register your window.open script
into client side.

If you have anything unclear, please feel free to tell me.

Have a nice day!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #3
Thanks Jeffery,

That is really something that ought to be added to the framework, put a
"target" parameter on hyperlinks and buttons.

Mark

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:6z**************@cpmsftngxa07.phx.gbl...

Hi Mark,

Thanks for posting in this group.
Actually, the .Net asp.net mechanism only encapsulates the client side html code and javascript. So all the works will be eventually get done throught
javascript code or html tag.
For your open a new window issue, .Net class library does not encapsulate a way to open a new window, so I think you need refer to window.open
javascript method.
If you want to get this done at server side runtime, I think you can use
Page.RegisterClientScriptBlock method to register your window.open script
into client side.

If you have anything unclear, please feel free to tell me.

Have a nice day!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #4

Hi Mark,

Thanks for your feedback.
For HyperLink Control, it will be rendered as <a> tag, you will find that
there is a Target field in this class.
While for buttons, its mainly usage is not for openning a web page(Although
you can add this function in its event through register client javascript
code for the button's click event), so the button classes do not have the
Target parameter.
I hope this makes sense to you, if you still have any concern, please feel
free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Debi | last post by:
Hi, I added a few buttons to the Mdi form, to call the child forms in the button click event. But when the child window opens, all the buttons are displayed in front of the child window. Any...
9
by: Karl Roes | last post by:
Hi All, I would like some advice on Next / Previous record buttons. I have a main form for the client, and a continuous subform listing client transactions. If I open one of these transactions...
2
by: j.mandala | last post by:
This had got to be something obvious that I am too blind to see! Funny problem: one of my users has my application linked to a SQL Server Backend. Front end it Access XP (SP3). The first form...
4
by: MrMike | last post by:
Hi. I have a hyperlink control (lnkViewLogData) which is assigned the following attribute when the page loads... Me.lnkViewLogData.Attributes.Add("onClick", _ ...
13
by: Seth Grimes | last post by:
Hello all, I want to open a window when a user leaves my site. I set up a function called by onUnload. To skip the window.open if the user hasn't left my site, I set a variable in my links and...
4
by: 981119 | last post by:
Hello all, First time in this forum, actually i'm no experience with javascript, i have one htm file which contains some javascript one quick question, can i add javascript to let it open with...
1
lwwhite
by: lwwhite | last post by:
Another question. On one of my forms, I have two radio buttons: Topic and Window. Beside each of them is a drop-down to select the corresponding topic or window. When Topic is selected the window...
9
by: Corni | last post by:
I have an application in Access 2003 OS XP Professional that I need to implement in my organization, has been received from another division of ours. When opened the form frmmain opens that has some...
7
by: Andrew Poulos | last post by:
Is there a way for javascript to know if a browser has been set to open new windows in tabs? I'm trying to fix some code that allows a user to close a window that javascript opened and it seems to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.