473,788 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple NavigateURL, I Think

Sorry, very Newbie question here. I don't know what I'm doing wrong. I have
to use a <asp:hyperlin k> to go to another page. I want to pick up the value
in a text box. This is what I've tried and It tells me it won't work. Not
sure how to do it.

NavigateUrl="~/secure/Confirm.aspx?No =201, IDate=" & TxtBx1.text & ", ODate
= "
& TxtBx2.text
Thank you in advance.
Mar 21 '06 #1
5 5009
Since the TextBox is a server control, your strategy will not get the
navigateUrl value to include the user entry until you post the form back to
the server. In which case, you should compose the NavigateUrl property upon
postback, e.g.

HyperLink1.Navi gateUrl ="~/secure/Confirm.aspx?No =201, IDate=" + TxtBx1.text
& ", ODate= " & TxtBx2.text
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Vear" wrote:
Sorry, very Newbie question here. I don't know what I'm doing wrong. I have
to use a <asp:hyperlin k> to go to another page. I want to pick up the value
in a text box. This is what I've tried and It tells me it won't work. Not
sure how to do it.

NavigateUrl="~/secure/Confirm.aspx?No =201, IDate=" & TxtBx1.text & ", ODate
= "
& TxtBx2.text
Thank you in advance.

Mar 21 '06 #2
On more aside note is that when composing querystring parameters you should
use the & instead of the commas as separators of parameters, e.g.

hl1.NavigateUrl = "~/secure/Confirm.aspx?No =201&IDate=" &
Server.HtmlEnco de(TxtBx1.text) + "&ODate= " & Server.HtmlEnco de(TxtBx2.text)

However, if you will compose the NavigateUrl on the server based on the
user's entry, you might as well consider using the Response.Redire ct to
redirect the user's display to the requested page instead of just composing a
hyperlink on which the user still has to click on to navigate to the required
page.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Phillip Williams" wrote:
Since the TextBox is a server control, your strategy will not get the
navigateUrl value to include the user entry until you post the form back to
the server. In which case, you should compose the NavigateUrl property upon
postback, e.g.

HyperLink1.Navi gateUrl ="~/secure/Confirm.aspx?No =201, IDate=" + TxtBx1.text
& ", ODate= " & TxtBx2.text
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Vear" wrote:
Sorry, very Newbie question here. I don't know what I'm doing wrong. I have
to use a <asp:hyperlin k> to go to another page. I want to pick up the value
in a text box. This is what I've tried and It tells me it won't work. Not
sure how to do it.

NavigateUrl="~/secure/Confirm.aspx?No =201, IDate=" & TxtBx1.text & ", ODate
= "
& TxtBx2.text
Thank you in advance.

Mar 21 '06 #3
Hi,

Thanks for your reply. The reason I've using a Hyperlink is because I want
them to click on an image with contains the link.

So if I understand properly, I can't refer to a text box through a hyperlink
unless I add it in code.
Thank you

"Phillip Williams" wrote:
On more aside note is that when composing querystring parameters you should
use the & instead of the commas as separators of parameters, e.g.

hl1.NavigateUrl = "~/secure/Confirm.aspx?No =201&IDate=" &
Server.HtmlEnco de(TxtBx1.text) + "&ODate= " & Server.HtmlEnco de(TxtBx2.text)

However, if you will compose the NavigateUrl on the server based on the
user's entry, you might as well consider using the Response.Redire ct to
redirect the user's display to the requested page instead of just composing a
hyperlink on which the user still has to click on to navigate to the required
page.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Phillip Williams" wrote:
Since the TextBox is a server control, your strategy will not get the
navigateUrl value to include the user entry until you post the form back to
the server. In which case, you should compose the NavigateUrl property upon
postback, e.g.

HyperLink1.Navi gateUrl ="~/secure/Confirm.aspx?No =201, IDate=" + TxtBx1.text
& ", ODate= " & TxtBx2.text
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Vear" wrote:
Sorry, very Newbie question here. I don't know what I'm doing wrong. I have
to use a <asp:hyperlin k> to go to another page. I want to pick up the value
in a text box. This is what I've tried and It tells me it won't work. Not
sure how to do it.

NavigateUrl="~/secure/Confirm.aspx?No =201, IDate=" & TxtBx1.text & ", ODate
= "
& TxtBx2.text
Thank you in advance.

Mar 21 '06 #4
Using the HyperLink control to display an image that can link to a URL is
quite alright. You just cannot compose its NavigateUrl property value from a
server control (such as the TextBox) without causing a round trip to the
server.

In programming for web applications, as opposed to desktop application, one
must understand the difference between the web server controls and the
objects that they render on the browser. The values that the user enter on
the objects displayed on the browser can be retrieved using the server
controls properties (such as the Text property of the TextBox) only when
posted back to the server; at which stage the ASP.NET engine constructs back
the server controls (e.g. the TextBox) from the browser objects.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Vear" wrote:
Hi,

Thanks for your reply. The reason I've using a Hyperlink is because I want
them to click on an image with contains the link.

So if I understand properly, I can't refer to a text box through a hyperlink
unless I add it in code.
Thank you

"Phillip Williams" wrote:
On more aside note is that when composing querystring parameters you should
use the & instead of the commas as separators of parameters, e.g.

hl1.NavigateUrl = "~/secure/Confirm.aspx?No =201&IDate=" &
Server.HtmlEnco de(TxtBx1.text) + "&ODate= " & Server.HtmlEnco de(TxtBx2.text)

However, if you will compose the NavigateUrl on the server based on the
user's entry, you might as well consider using the Response.Redire ct to
redirect the user's display to the requested page instead of just composing a
hyperlink on which the user still has to click on to navigate to the required
page.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Phillip Williams" wrote:
Since the TextBox is a server control, your strategy will not get the
navigateUrl value to include the user entry until you post the form back to
the server. In which case, you should compose the NavigateUrl property upon
postback, e.g.

HyperLink1.Navi gateUrl ="~/secure/Confirm.aspx?No =201, IDate=" + TxtBx1.text
& ", ODate= " & TxtBx2.text
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Vear" wrote:

> Sorry, very Newbie question here. I don't know what I'm doing wrong. I have
> to use a <asp:hyperlin k> to go to another page. I want to pick up the value
> in a text box. This is what I've tried and It tells me it won't work. Not
> sure how to do it.
>
> NavigateUrl="~/secure/Confirm.aspx?No =201, IDate=" & TxtBx1.text & ", ODate
> = "
> & TxtBx2.text
>
>
> Thank you in advance.

Mar 21 '06 #5
Thanks so much for your help. I have a better understanding of the process.

"Phillip Williams" wrote:
Using the HyperLink control to display an image that can link to a URL is
quite alright. You just cannot compose its NavigateUrl property value from a
server control (such as the TextBox) without causing a round trip to the
server.

In programming for web applications, as opposed to desktop application, one
must understand the difference between the web server controls and the
objects that they render on the browser. The values that the user enter on
the objects displayed on the browser can be retrieved using the server
controls properties (such as the Text property of the TextBox) only when
posted back to the server; at which stage the ASP.NET engine constructs back
the server controls (e.g. the TextBox) from the browser objects.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Vear" wrote:
Hi,

Thanks for your reply. The reason I've using a Hyperlink is because I want
them to click on an image with contains the link.

So if I understand properly, I can't refer to a text box through a hyperlink
unless I add it in code.
Thank you

"Phillip Williams" wrote:
On more aside note is that when composing querystring parameters you should
use the & instead of the commas as separators of parameters, e.g.

hl1.NavigateUrl = "~/secure/Confirm.aspx?No =201&IDate=" &
Server.HtmlEnco de(TxtBx1.text) + "&ODate= " & Server.HtmlEnco de(TxtBx2.text)

However, if you will compose the NavigateUrl on the server based on the
user's entry, you might as well consider using the Response.Redire ct to
redirect the user's display to the requested page instead of just composing a
hyperlink on which the user still has to click on to navigate to the required
page.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Phillip Williams" wrote:

> Since the TextBox is a server control, your strategy will not get the
> navigateUrl value to include the user entry until you post the form back to
> the server. In which case, you should compose the NavigateUrl property upon
> postback, e.g.
>
> HyperLink1.Navi gateUrl ="~/secure/Confirm.aspx?No =201, IDate=" + TxtBx1.text
> & ", ODate= " & TxtBx2.text
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Vear" wrote:
>
> > Sorry, very Newbie question here. I don't know what I'm doing wrong. I have
> > to use a <asp:hyperlin k> to go to another page. I want to pick up the value
> > in a text box. This is what I've tried and It tells me it won't work. Not
> > sure how to do it.
> >
> > NavigateUrl="~/secure/Confirm.aspx?No =201, IDate=" & TxtBx1.text & ", ODate
> > = "
> > & TxtBx2.text
> >
> >
> > Thank you in advance.

Mar 21 '06 #6

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

Similar topics

2
4609
by: GhislainTanguay | last post by:
This is my XML file and below you will find my code to remove it... I was thinking that it's a simple task but this code doesn't work. Anybody have a better solution? <Advertisements>
1
1740
by: timmso | last post by:
I am trying to build a simple asp.net project. What sort of control do I need to use to simply display a list of links in a table format? For example, let's say I have a database table: tblNames ID Name 1 Blue 2 Grey 3 Green
4
2520
by: Keith | last post by:
I have this simple scenario. -------- Choose an item ->dropdownlist-> or <a>Create a new item</a> -------- When someone decides to click on the create a new item link, it takes them to a page in which they can enter more records to the database field to which the dropdownlist is bound.
3
333
by: Manny Chohan | last post by:
hi guys, i am creating Hyperlink control in the codebehind and adding it to the panel. The problem is that they are ending up next to each other without any space between them. can someone recomend based on my code how i can get a space about a tab between each hyperlinks. here is my code: HyperLink MyHyperLink = new HyperLink(); MyHyperLink.NavigateUrl = attachment.Address.ToString();
4
4237
by: Tomek R. | last post by:
Hello ! This post does'nt regard column hyperlink. I just have single hyperlink and want to create it's NavigateUrl dynamically. This is my test page <form id="Form1" method="post" runat="server"> <asp:HyperLink id="MyHLink" NavigateUrl='<%# geturl("123456") %>'
3
3408
by: VB Programmer | last post by:
I have a datalist with a hyperlink in the Item Template. When I set the NavigateUrl simply to this, the databound CategoryId shows up fine: <asp:HyperLink id=hlLink runat="server" NavigateUrl='<%#Container.DataItem("CategoryId")%>'> <%# Container.DataItem("CategoryName") %> </asp:HyperLink>&nbsp;
1
2097
by: jeanluc.praz | last post by:
I created a user control containing containing a few hyperlinks. How can I change the NavigateUrl inside the user control ? So far I did the following: 1) In the custom control Public Property SetURL() Get
1
1036
by: Carlos | last post by:
Hi all, I would like to have a hyperlink control inside a table that just uses the value of a string being passed from the previous page. for example when navigating from the default page the string is mypage.aspx?id='23', I would like the hyperlink inside a table in the mypage.aspx to grab the id to navigate to a third page. i.e.so that the navigateurl property could read:
6
23523
by: Dmitry Duginov | last post by:
I have a FormView and a HyperLink on the page. If I use the following code behind (hooked up to Hyperlink's OnLoad event), it renders fine protected void link_Load(object sender, EventArgs e) { link.NavigateUrl = String.Format("~/Carrier/AddNew.aspx?Id={0}", FormView1.DataKey.Value); }
0
9498
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
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
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...
0
9964
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...
0
8993
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
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
6749
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();...
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.