473,770 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing parameters to hyperlink control

I have this line of code in my .aspx page

<asp:HyperLin k 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:Bl ue;">View Customer</a>

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

Don't pass parameters to the control, then it renders correctly
<asp:HyperLin k ID="hrefView" CssClass="main" ForeColor="blue " Runat="server"
NavigateUrl='Vi ew.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 9354
Hi why not perform this operation from the code-behind?

Or:

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

Yama

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

<asp:HyperLin k 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:Bl ue;">View Customer</a>

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

Don't pass parameters to the control, then it renders correctly
<asp:HyperLin k ID="hrefView" CssClass="main" ForeColor="blue "
Runat="server"
NavigateUrl='Vi ew.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*****@stbern ard.com> wrote in message
news:OD******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi why not perform this operation from the code-behind?

Or:

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

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

<asp:HyperLin k 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:Bl ue;">View Customer</a>

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

Don't pass parameters to the control, then it renders correctly
<asp:HyperLin k ID="hrefView" CssClass="main" ForeColor="blue "
Runat="server"
NavigateUrl='Vi ew.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**@wizardone s.com> wrote in message
news:O7******** *****@TK2MSFTNG P10.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*****@stbern ard.com> wrote in message
news:OD******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi why not perform this operation from the code-behind?

Or:

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

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

Customer</asp:HyperLink>

Yama

"Lan H. Nguyen" <la**@wizardone s.com> wrote in message
news:e9******** ******@TK2MSFTN GP12.phx.gbl...
>I have this line of code in my .aspx page
>
> <asp:HyperLin k 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:Bl ue;">View Customer</a>
>
> Not working either when removed the ID
> <asp:HyperLin k ID="hrefView" CssClass="main" ForeColor="blue "
> Runat="server"
> NavigateUrl='<% # "View.aspx?id=1 00"%>'>View Customer</asp:HyperLink>
>
> Don't pass parameters to the control, then it renders correctly
> <asp:HyperLin k ID="hrefView" CssClass="main" ForeColor="blue "
> Runat="server"
> NavigateUrl='Vi ew.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.ToStrin g(DataBinder.Ev al(Container.Da taItem, "ID")) %>
"Lan H. Nguyen" <la**@wizardone s.com> wrote in message
news:O7******** *****@TK2MSFTNG P10.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*****@stbern ard.com> wrote in message
news:OD******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi why not perform this operation from the code-behind?

Or:

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

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

Customer</asp:HyperLink>

Yama

"Lan H. Nguyen" <la**@wizardone s.com> wrote in message
news:e9******** ******@TK2MSFTN GP12.phx.gbl...
>I have this line of code in my .aspx page
>
> <asp:HyperLin k 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:Bl ue;">View Customer</a>
>
> Not working either when removed the ID
> <asp:HyperLin k ID="hrefView" CssClass="main" ForeColor="blue "
> Runat="server"
> NavigateUrl='<% # "View.aspx?id=1 00"%>'>View Customer</asp:HyperLink>
>
> Don't pass parameters to the control, then it renders correctly
> <asp:HyperLin k ID="hrefView" CssClass="main" ForeColor="blue "
> Runat="server"
> NavigateUrl='Vi ew.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
17357
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 (update, append) should be activated in order to transfer data to other tables. I tried to avoid any coding in VB, as I am not a professional, but I have found a statement in an article, that, unlike select queries, form's Input Property can't be...
0
1100
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 "" even though there is a value: e.Item.Cells.Text I have verified it's the right cell, since I've gone through all of them and they all return what they're supposed to, except of course the hyperlink!
2
46404
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 at .ascx? Thank you for your help!
0
1335
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 to refuse it. Why? Because I want to use these links on forms that may have unsaved changes - and I don't want them to lose the changes by clicking on the hyperlink. Unfortunately, I find the web controls bewildering. I would have thought...
0
2256
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 successfully gotten it working. The only problem I have is with passing parameters to the Windows Forms User control from IE I am using the Object tag to instantiate the IE object I am using param tags inside object tag to pass paramaters but the...
2
2441
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 "mailto:" prefix) in order to activate the mailto link; I'm getting errors where I try to put the mailto into the control coding. Am I going about this wrong or is there a way to do this inside the hyperlink control's NavigateURL property? Rod
6
1825
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 following javascript to open another window and would like to control these attributes with the hyperlink control: window.open(msgSubmitterInfo,t,s);return false" var s="toolbar=no,directories=no,scrollbars=yes,resizable=yes,"; s+= ...
4
3147
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, I'm running the following code:
4
7158
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" OR... the only way to do it is to use the QueryString or Session object?
1
3774
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 one hyperlink controls. <asp:Label ID="Label1" runat="server" style="z-index: 1; left: 77px; top: 280px; position: absolute; height: 24px"
0
9618
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
10259
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...
1
10038
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
9906
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
7456
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
6710
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
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
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.