473,748 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hyperlink variable

Something simple here (hopefully)...h ow can I append the text in a
text box to a hyperlink? For example, I enter the string 'Printer223'.
There is an Excel file with the same name that I want to open
(Printer223.xls ). Basically http://localhost/printers/whatever I put
in the textbox.xls is what I'm after. Thanks.

Jun 4 '07 #1
3 2308
On Jun 4, 10:12 pm, Looch <lucianoj2...@y ahoo.comwrote:
Something simple here (hopefully)...h ow can I append the text in a
text box to a hyperlink? For example, I enter the string 'Printer223'.
There is an Excel file with the same name that I want to open
(Printer223.xls ). Basicallyhttp://localhost/printers/whateverI put
in the textbox.xls is what I'm after. Thanks.
How do you want to open the file? Using a postback button?

Response.Redire ct("http://localhost/printers/" + TextBox1.Text +
".xls");

Jun 4 '07 #2
On Jun 4, 4:18 pm, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On Jun 4, 10:12 pm, Looch <lucianoj2...@y ahoo.comwrote:
Something simple here (hopefully)...h ow can I append the text in a
text box to a hyperlink? For example, I enter the string 'Printer223'.
There is an Excel file with the same name that I want to open
(Printer223.xls ). Basicallyhttp://localhost/printers/whateverIput
in the textbox.xls is what I'm after. Thanks.

How do you want to open the file? Using a postback button?

Response.Redire ct("http://localhost/printers/" + TextBox1.Text +
".xls");
Basically I just need to do this (using VBScript). The example below
doesn't seem to work though.

"http://amslpsvr1/consumables/OrderForms/" & strOrder &".xls"

Here's the actual code (I'm a noob but I can get any Excel file to
open this way!)

<script language ='vbscript' >
dim objExcel
dim wb
dim strOrder as string = me.txtOrderFrm. text
Sub cmdOrderFrm_onc lick()
call OpenWorkbook("h ttp://amslpsvr1/consumables/OrderForms/" &
strOrder & ".xls")
end sub
sub OpenWorkbook(st rLocation)
set objExcel = CreateObject("E xcel.Applicatio n")
objExcel.Visibl e = true
objExcel.Workbo oks.Open (strLocation)
objExcel.UserCo ntrol = true
end sub
</script>

Thanks again for any help.

Jun 4 '07 #3
Looch wrote:
On Jun 4, 4:18 pm, Alexey Smirnov <alexey.smir... @gmail.comwrote :
>On Jun 4, 10:12 pm, Looch <lucianoj2...@y ahoo.comwrote:
>>Something simple here (hopefully)...h ow can I append the text in a
text box to a hyperlink? For example, I enter the string 'Printer223'.
There is an Excel file with the same name that I want to open
(Printer223.x ls). Basicallyhttp://localhost/printers/whateverIput
in the textbox.xls is what I'm after. Thanks.
How do you want to open the file? Using a postback button?

Response.Redir ect("http://localhost/printers/" + TextBox1.Text +
".xls");

Basically I just need to do this (using VBScript). The example below
doesn't seem to work though.

"http://amslpsvr1/consumables/OrderForms/" & strOrder &".xls"

Here's the actual code (I'm a noob but I can get any Excel file to
open this way!)

<script language ='vbscript' >
dim objExcel
dim wb
dim strOrder as string = me.txtOrderFrm. text
Sub cmdOrderFrm_onc lick()
call OpenWorkbook("h ttp://amslpsvr1/consumables/OrderForms/" &
strOrder & ".xls")
end sub
sub OpenWorkbook(st rLocation)
set objExcel = CreateObject("E xcel.Applicatio n")
objExcel.Visibl e = true
objExcel.Workbo oks.Open (strLocation)
objExcel.UserCo ntrol = true
end sub
</script>

Thanks again for any help.
First of all, you are in the wrong newsgroup. This has nothing to do
with ASP.NET.

Anyway, depending on where you put the script, you are either getting
the value from the text box when the page is loading, or trying to get
it before the text box even exists.

If you want to get the value from the text box at the time of calling
the cmdOrderForm_on click subroutine, you have to put the code that gets
the value inside the subroutine.

Note also that "me" gets a different meaning if you put it inside the
subroutine, as it then will refer to the control that you clicked rather
than the window object.

--
Göran Andersson
_____
http://www.guffa.com
Jun 5 '07 #4

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

Similar topics

1
7436
by: Newbie | last post by:
OK, this may be impossible since I'm using 3rd party shopping cart ASP software, but I've been able to finagle a lot of other stuff I thought wouldn't work, so here we go: I'm using a form in which users enter numbers to be calculated into a square footage cost. Upon submitting, the results page uses ASP to give the total and the chance to add the new totalled item to the cart or try a new calculation. Part of the cart's software has a...
2
2335
by: laura | last post by:
I am writing an intranet and want to be able to hyperlink to all files within a specific folder AND it's subfolders. Whilst I can hyperlink to the files in the specified folder AND I can also iterate through the subfolders and list them, for some reason I cannot hyperlink to the sub folders. I am writing this software at home using a computer that has IIS and Windows 98 and am accessing this as my server from another computer on my network....
4
9201
by: opt_inf_env | last post by:
Hello, I know three ways to pass variables form one page to another. The first one is to declare and set session variable. In this case if one goes to another page (by clicking on hyperlink or pressing a button) value of a session variable will be automatically seen on the new page. The second way is to set hidden variables in the form and go to new page by execution of this form (press a button or enter), and the last way, which I...
0
2210
by: Dave | last post by:
Hi , I have the following where I need to append a string variable inside a hyperlink template, inside a datalist. The variable 'categoryList' is the culprit. No matter where this variable is declared, the compiler says it is 'undefined'. What am I missing here? I am a newbie to ASP.NET trying to rebuild my ASP library.
7
1603
by: G. Dean Blake | last post by:
I have a hyperlink on my aspx page added at dev time. Is there a way to execute it from code? Thanks, G
2
1498
by: MrMike | last post by:
I am attempting to pass a parameter named "BackURL" into a asp:Hyperlink HTML control as shown below. "BackURL" is actually a variable defined in the page's code-behind. However, my current formatting below causes a "Page cannot be displayed" error, and is invalid. How can I properly reference my BackURL variable in the NavigateURL property of the asp:Hyperlink control? Thanks. <asp:HyperLink runat="server" Text="Update"...
2
4732
by: Keith Wilby | last post by:
A2003, XP Pro. I have a text box on a form. The text box is bound to a hyperlink field. I want to use the contents of the text box in code so I'm assigning the contents to a string variable. Typically, the contents would be: T:\CSDI\Projects\Library\002\8021889.doc but when I look at the variable what I see is: T:\CSDI\Projects\Library\002\8021889.doc#T:\CSDI\Projects\Library\002\8021889.doc#
2
2146
by: vndaxanh | last post by:
Hi everyone, I have an aspx page with a datagrid column which bound to a dataset at page_load. It contains 2 columns, Key and Hyperlink. What I want to do is when I click on the hyperlink it will set a session variable to the Key column like so: Session = column 0 of row of the hyperlink clicked on. How do I do this? Thanks in a advance for your help!
5
5143
by: widevision7 | last post by:
I am creating a web site where I want to have a hyperlink that executes a Perl script. At the same time, I want to pass along a variable inside of the hyperlink that the Perl script can use when it executes. I don't want to use a form unless it is necessary. The hyperlink might look like this: <a href=get_info.pl?variable="chicken">I like fried chicken</a> So, when the user clicks on the link, the Perl script named "get_info.pl"...
6
11968
hgeithus
by: hgeithus | last post by:
Hi. I have a session variable stored within a cookie, and I want this to change when pressing a hyperlink. i.e. I have this variable $_SESSION = 'en_US'; This is set initially if it hasn't been set before using an if statement:
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9326
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.