473,395 Members | 1,474 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.

passing parameters to hyperlink control

I have this line of code in my .aspx page

<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue" Runat="server"
NavigateUrl='<%# "View.aspx?id=" + ID.ToString()%>'>View
Customer</asp:HyperLink>

But when the page runs it shows text only "View Customer" without hyperlink.
This is what it was rendered in the page source <a id="hrefView"
class="main" style="color:Blue;">View Customer</a>

Not working either when removed the ID
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue" Runat="server"
NavigateUrl='<%# "View.aspx?id=100"%>'>View Customer</asp:HyperLink>

Don't pass parameters to the control, then it renders correctly
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue" Runat="server"
NavigateUrl='View.aspx'>View Customer</asp:HyperLink>

Does anybody have any ideas what I'm doing wrong here. Any help is
appreciated.

Lan
Nov 18 '05 #1
4 9329
Hi why not perform this operation from the code-behind?

Or:

Change the following:
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue" Runat="server"
NavigateUrl='View.aspx?id=<%# ID.ToString()%>'>View Customer</asp:HyperLink>

Yama

"Lan H. Nguyen" <la**@wizardones.com> wrote in message
news:e9**************@TK2MSFTNGP12.phx.gbl...
I have this line of code in my .aspx page

<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
Runat="server"
NavigateUrl='<%# "View.aspx?id=" + ID.ToString()%>'>View
Customer</asp:HyperLink>

But when the page runs it shows text only "View Customer" without
hyperlink.
This is what it was rendered in the page source <a id="hrefView"
class="main" style="color:Blue;">View Customer</a>

Not working either when removed the ID
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
Runat="server"
NavigateUrl='<%# "View.aspx?id=100"%>'>View Customer</asp:HyperLink>

Don't pass parameters to the control, then it renders correctly
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
Runat="server"
NavigateUrl='View.aspx'>View Customer</asp:HyperLink>

Does anybody have any ideas what I'm doing wrong here. Any help is
appreciated.

Lan

Nov 18 '05 #2
Thanks for the response.
Yes I can surely do this from the code behind, it's just that I am curious
of what is possibly wrong to my code.

Your other solution shows the link alright but give this on the url
View.aspx?id=<%# ID.ToString()%>

"Yama" <yk*****@stbernard.com> wrote in message
news:OD****************@TK2MSFTNGP14.phx.gbl...
Hi why not perform this operation from the code-behind?

Or:

Change the following:
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue" Runat="server" NavigateUrl='View.aspx?id=<%# ID.ToString()%>'>View Customer</asp:HyperLink>
Yama

"Lan H. Nguyen" <la**@wizardones.com> wrote in message
news:e9**************@TK2MSFTNGP12.phx.gbl...
I have this line of code in my .aspx page

<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
Runat="server"
NavigateUrl='<%# "View.aspx?id=" + ID.ToString()%>'>View
Customer</asp:HyperLink>

But when the page runs it shows text only "View Customer" without
hyperlink.
This is what it was rendered in the page source <a id="hrefView"
class="main" style="color:Blue;">View Customer</a>

Not working either when removed the ID
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
Runat="server"
NavigateUrl='<%# "View.aspx?id=100"%>'>View Customer</asp:HyperLink>

Don't pass parameters to the control, then it renders correctly
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
Runat="server"
NavigateUrl='View.aspx'>View Customer</asp:HyperLink>

Does anybody have any ideas what I'm doing wrong here. Any help is
appreciated.

Lan


Nov 18 '05 #3
Try <%= ID.ToString()%>

"Lan H. Nguyen" <la**@wizardones.com> wrote in message
news:O7*************@TK2MSFTNGP10.phx.gbl...
Thanks for the response.
Yes I can surely do this from the code behind, it's just that I am curious
of what is possibly wrong to my code.

Your other solution shows the link alright but give this on the url
View.aspx?id=<%# ID.ToString()%>

"Yama" <yk*****@stbernard.com> wrote in message
news:OD****************@TK2MSFTNGP14.phx.gbl...
Hi why not perform this operation from the code-behind?

Or:

Change the following:
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"

Runat="server"
NavigateUrl='View.aspx?id=<%# ID.ToString()%>'>View

Customer</asp:HyperLink>

Yama

"Lan H. Nguyen" <la**@wizardones.com> wrote in message
news:e9**************@TK2MSFTNGP12.phx.gbl...
>I have this line of code in my .aspx page
>
> <asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
> Runat="server"
> NavigateUrl='<%# "View.aspx?id=" + ID.ToString()%>'>View
> Customer</asp:HyperLink>
>
> But when the page runs it shows text only "View Customer" without
> hyperlink.
> This is what it was rendered in the page source <a id="hrefView"
> class="main" style="color:Blue;">View Customer</a>
>
> Not working either when removed the ID
> <asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
> Runat="server"
> NavigateUrl='<%# "View.aspx?id=100"%>'>View Customer</asp:HyperLink>
>
> Don't pass parameters to the control, then it renders correctly
> <asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
> Runat="server"
> NavigateUrl='View.aspx'>View Customer</asp:HyperLink>
>
> Does anybody have any ideas what I'm doing wrong here. Any help is
> appreciated.
>
> Lan
>
>



Nov 18 '05 #4
Or try this:
<%# Convert.ToString(DataBinder.Eval(Container.DataIte m, "ID")) %>
"Lan H. Nguyen" <la**@wizardones.com> wrote in message
news:O7*************@TK2MSFTNGP10.phx.gbl...
Thanks for the response.
Yes I can surely do this from the code behind, it's just that I am curious
of what is possibly wrong to my code.

Your other solution shows the link alright but give this on the url
View.aspx?id=<%# ID.ToString()%>

"Yama" <yk*****@stbernard.com> wrote in message
news:OD****************@TK2MSFTNGP14.phx.gbl...
Hi why not perform this operation from the code-behind?

Or:

Change the following:
<asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"

Runat="server"
NavigateUrl='View.aspx?id=<%# ID.ToString()%>'>View

Customer</asp:HyperLink>

Yama

"Lan H. Nguyen" <la**@wizardones.com> wrote in message
news:e9**************@TK2MSFTNGP12.phx.gbl...
>I have this line of code in my .aspx page
>
> <asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
> Runat="server"
> NavigateUrl='<%# "View.aspx?id=" + ID.ToString()%>'>View
> Customer</asp:HyperLink>
>
> But when the page runs it shows text only "View Customer" without
> hyperlink.
> This is what it was rendered in the page source <a id="hrefView"
> class="main" style="color:Blue;">View Customer</a>
>
> Not working either when removed the ID
> <asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
> Runat="server"
> NavigateUrl='<%# "View.aspx?id=100"%>'>View Customer</asp:HyperLink>
>
> Don't pass parameters to the control, then it renders correctly
> <asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue"
> Runat="server"
> NavigateUrl='View.aspx'>View Customer</asp:HyperLink>
>
> Does anybody have any ideas what I'm doing wrong here. Any help is
> appreciated.
>
> Lan
>
>



Nov 18 '05 #5

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

Similar topics

2
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
0
by: ann | last post by:
I am trying to access the text of the hyperlink control during the delete command. I am retrieving the ID in there as well and it works fine:e.Item.Cells.Text The hyperlink code is returning...
2
by: Akira | last post by:
Hello. I'm having problem with passing parameters from .aspx file to user control. Could anyone tell me how to pass parameters from .aspx file to user control(.ascx) and how to recieve parameters...
0
by: Tom Jorgenson | last post by:
I need to create a custom control that behaves like a HyperLink control EXCEPT where I can get into the events somewhere to programmatically decided whether to actually perform the link request, or...
0
by: Neelima Godugu | last post by:
Hi All, I have developed a windows forms user control, which I am going to host in Internet Explorer.. I am familiar with the security settings requirement inorder to do the above. I have...
2
by: Rod Snyder | last post by:
I have a hyperlink control for which the text property is the xxx@xxx.com address in a db field. I want to display this and set the NavigateURL field of the control to the same field (with a...
6
by: sck10 | last post by:
Hello, Can you control the window attributes (toolbar, scrollbars, left and right exc.) when using the hyperlink control as you would when using javascript? For examle, I am using the...
4
by: Mark Rae | last post by:
Hi, I have an <asp:PlaceHolder control on a page in an ASP.NET 1.1 app, as follows: <td nowrap><asp:PlaceHolder ID="phClientWebsite" Runat=server>&nbsp;</asp:PlaceHolder></td> Server-side,...
4
by: David Freeman | last post by:
Hi There! I'm just wondering if there's a way to pass parameters (as if you were passing parameters to a ASCX web control) when calling an ASPX page? e.g. MyDetailsPage.UserName = "david" ...
1
by: sivasrec | last post by:
Hi, This is sivakumar from India. Now I am learning to ASP.NET 2.0.. I have a doubt.... I have used in a one hidden field control, 2 label controls, 2 button controls and...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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...

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.