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

Simple NavigateURL, I Think

Sorry, very Newbie question here. I don't know what I'm doing wrong. I have
to use a <asp:hyperlink> 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 4987
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.NavigateUrl ="~/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:hyperlink> 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.HtmlEncode(TxtBx1.text) + "&ODate= " & Server.HtmlEncode(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.Redirect 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.NavigateUrl ="~/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:hyperlink> 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.HtmlEncode(TxtBx1.text) + "&ODate= " & Server.HtmlEncode(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.Redirect 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.NavigateUrl ="~/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:hyperlink> 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.HtmlEncode(TxtBx1.text) + "&ODate= " & Server.HtmlEncode(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.Redirect 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.NavigateUrl ="~/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:hyperlink> 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.HtmlEncode(TxtBx1.text) + "&ODate= " & Server.HtmlEncode(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.Redirect 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.NavigateUrl ="~/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:hyperlink> 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
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
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...
4
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...
3
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...
4
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"...
3
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"...
1
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...
1
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...
6
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)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.