Help on binding syntax ??

G

Guest

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
 
K

Karl Seguin [MVP]

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
 
B

Bruce Barker

you probably never called the databind method of the control.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top