473,387 Members | 1,890 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,387 software developers and data experts.

Help on binding syntax ??

Dear all,

I have the following item on my form :

<asp:HyperLink id="lblEvtNb" runat="server"
NavigateUrl="Event.aspx?id=">Click here</asp:HyperLink>

I need to pass as url parameter an Id which is a label.Text string of my form
At the end the url should be : "Event.aspx?Id=32"

I try to do the following:
<asp:HyperLink id="lblEvtNb" runat="server"
NavigateUrl='<%#"Event.aspx?id=" & lblReelId.Text %>'>Click
here</asp:HyperLink>

When running my code, no hyperlink is created, what I am doing wrong ?
I have try also to access the parameter through a property, but same results

Thnaks for your help
regards
serge
Jan 30 '06 #1
2 1214
the binding syntax %# is use specifically when databinding specific controls
(checkboxlist, dropdownlist, repeater, datalist, datagrid, ...) via the
DataBind() method.

From the sound of it, you simply want to dynamically set the property of a
control. I assume you want this to happen after a some type of postback - I
mean, initially, there won't be a value inthe textbox

if Page.IsPostBack then
lblEvtNb.NavigateUrl = string.Format("Event.aspx?id={0}",
lblReelId.Text")
end if
Karl

--
http://www.openmymind.net/

"serge calderara" <se************@discussions.microsoft.com> wrote in
message news:FA**********************************@microsof t.com...
Dear all,

I have the following item on my form :

<asp:HyperLink id="lblEvtNb" runat="server"
NavigateUrl="Event.aspx?id=">Click here</asp:HyperLink>

I need to pass as url parameter an Id which is a label.Text string of my
form
At the end the url should be : "Event.aspx?Id=32"

I try to do the following:
<asp:HyperLink id="lblEvtNb" runat="server"
NavigateUrl='<%#"Event.aspx?id=" & lblReelId.Text %>'>Click
here</asp:HyperLink>

When running my code, no hyperlink is created, what I am doing wrong ?
I have try also to access the parameter through a property, but same
results

Thnaks for your help
regards
serge

Jan 30 '06 #2
you probably never called the databind method of the control.

-- bruce (sqlwork.com)

"serge calderara" <se************@discussions.microsoft.com> wrote in
message news:FA**********************************@microsof t.com...
Dear all,

I have the following item on my form :

<asp:HyperLink id="lblEvtNb" runat="server"
NavigateUrl="Event.aspx?id=">Click here</asp:HyperLink>

I need to pass as url parameter an Id which is a label.Text string of my
form
At the end the url should be : "Event.aspx?Id=32"

I try to do the following:
<asp:HyperLink id="lblEvtNb" runat="server"
NavigateUrl='<%#"Event.aspx?id=" & lblReelId.Text %>'>Click
here</asp:HyperLink>

When running my code, no hyperlink is created, what I am doing wrong ?
I have try also to access the parameter through a property, but same
results

Thnaks for your help
regards
serge

Jan 30 '06 #3

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

Similar topics

4
by: Vinay | last post by:
Hello My question is regarding "weak external symbols". Consider the following eg. class test { public : int func1(void); {cout <<"func1";} int func2(void);
1
by: JD Kronicz | last post by:
Hi .. I have an issue I have been beating my head against the wall on for some time. I am trying to use late binding for MS graph so that my end users don't have to worry about having the right...
11
by: JV | last post by:
I just converted a big web project from VB.NET to C# and I got some very strange runtime errors. Apparently, throughout the ASPX pages, the VB version of this project used the expression <%#...
2
by: Daniel | last post by:
I'm new to .Net and all of its abilities so I hope this makes sense. Basically I'm confused on when is the appropriate time to use web forms controls vs. regular HTML. For example in ASP...
2
by: Gastin | last post by:
I am consuming a web serivce from Amazon.Com. I have the following class which was autogenerated by VS.NET when I created a Web Reference to...
6
by: Scott Mueller | last post by:
I have a question about simple binding: (please forgive any syntax errors... I am at home, where I do not have Vb.Net installed, and I rely far too much on Vb's intellisense!) If I have two...
4
by: Steven Smith | last post by:
Hi guy's whats the syntax for binding the text property of a textbox to a particular field in a dataview programatically ? here's the scenario my form has two main sections the first is a...
3
by: TS | last post by:
when binding to a datagrid for example, is it possible to use databinding syntax to bind to a property of a property? Say the datasource="Cars" which is a collection of car classes and the...
18
by: mdh | last post by:
>From p112 ( K&R). Given an array declared as static char arr= { { 0,1,........},{0,1,.....}}; let arr be passed as an argument to f. f( int (*arr) ) {....} It is noted that the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
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,...

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.