C'tor of WebUserControl

G

Guest

hi,

How can I call to a Function/Property and send data dynamically to the
UserControl ? I mean Instead (look at CurrentPage):
<Result:Header id="rh" CurrentPage="1" RecordsPerPage="2" runat="server" />
To do:
<Result:Header id="rh" CurrentPage="GetText()" RecordsPerPage="2"
runat="server" />

GetText() -> on the Webform...

(code was taken from your link below...)
http://openmymind.net/index.aspx?documentId=9

thanx,
Oren
 
G

Guest

If you need two way communication, work in CodeBehind. If you simply need to
pull a value to the control, you can use the <%# %> tags to get at your Page
CodeBehind and have that get at control properties.

I believe the manner in which you are attempting is out of order, as the
tags are rendered after pre-render. I may be incorrect on that. If so, you
are asking for the constructor to pull information it will not have until
your property is populated.

Either way, it is easier to stick to CodeBehind if you want to start
customizing the way your app renders controls.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
G

Guest

Gregory,

It still dosen't work:
<Result:Header id="rh" CurrentPage=<%#GetText()%> RecordsPerPage="2"
runat="server" />
.....
GetText()-> function/property on Webform

Oren
 
S

Scott Allen

G

Guest

Hi Gregory,

Please let me explain again:

I have WebUserControl on a Webform.
How can I sent dynamically to the WebUserControl from a Function/Property on
the Webform ? (data="2" is a static way)
<uc:myuc id="myid1" CurrentPage=<%#GetText()%> data="2" runat="server"/>
.....
GetText()-> function/property on the Webform, returns string and send it to
the WebUserControl -> <%#GetText()%>

It's not working. no data is being send. any idea why ?

thanx,
Oren
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top