question about databind in user control

¥

¥øÃZ½Þ

Dear All

I have write a user control which is uses to popup a new browser and
inherited ImageButton

It have a user defined property named url

and in the aspx page, the code like this

<ctl:popupImageButtonControl id="ctlButton"
runat="server"

url='page.aspx?parameter1=<%# DataBinder.Eval(Container,
"DataItem.Parameter1")%>&parameter2=<%# DataBinder.Eval(Container,
"DataItem.Parameter2")%>&'/>

In above case, if i pass <%# DataBinder.Eval(Container,
"DataItem.Parameter1")%> only, it can bind, however, if i bind the data with
some other string, it cannot bind the data to the property, is it possible
to bind the data to the property with string appended?

Thanks
 
G

Guest

When you're databinding a property....you can only have a databinding
expression or a string expression....not a combination of both.

so.....try this:
url='<%# "page.aspx?parameter1="+DataBinder.Eval(Container,
"DataItem.Parameter1")+"Parameter2="+DataBinder.Eval(Container,
"DataItem.Parameter2") %>'
 
¥

¥øÃZ½Þ

oh...~ ic~~ thanks a lot~
^.^

David Jessee said:
When you're databinding a property....you can only have a databinding
expression or a string expression....not a combination of both.

so.....try this:
url='<%# "page.aspx?parameter1="+DataBinder.Eval(Container,
"DataItem.Parameter1")+"Parameter2="+DataBinder.Eval(Container,
"DataItem.Parameter2") %>'
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top