Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamicly setting readonly in through a property

7 views
Skip to first unread message

Martin Gregersen

unread,
Nov 27, 2006, 3:59:27 AM11/27/06
to
Hi

Looking for a way to bind a readonly property on a textbox to a parameter,
not having to cycle through all controls, but rather setting <textbox
id="myTextbox" readonly="<%# SetReadOnly %> where SetReadOnly is a public
property, saved to a Session variable.

Can't get it to work, eventhough the designer shows and says that it is
databound... When I debug I can see that it never accesses the property, as
if it just says 'Okay, the vaule "<%# SetReadOnly %>" is not "true", it must
be "false"...'

Hope somebody can (and will ;o) ) help me...

Thanks...

Martin Gregersen
WebShine A/S
greg...@webshine.dk


Masudur

unread,
Nov 27, 2006, 4:34:05 AM11/27/06
to
Dear Martin,

I am not sure about the actual context of your problem.

If you set a data binding code that refers to a public variable of the
page. You must call Page.DataBind() to bind the variable to target
element. Please Check wheither you have Page.DataBind() method called
in your pageload event.

Thanks.
Md. Masudur Rahman
www.kaz.com.bd
KAZ Software Ltd.
Software outsourcing made simple...

Martin Gregersen

unread,
Nov 27, 2006, 5:00:20 AM11/27/06
to
Hi Masudur

Thanks for your swift reply, turns out you are right. :o) I just added a
"Databind();" ind the Page_Load(), and then it worked...

I actually found out myself shortly after posting this question - and now I
wanted to go close it myself, but you where faster than me ;o)

Martin Gregersen
WebShine A/S
greg...@webshine.dk


"Masudur" <mun...@gmail.com> wrote in message
news:1164620045.1...@l39g2000cwd.googlegroups.com...

0 new messages