Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Martin Gregersen #1
Dynamicly setting readonly in through a property
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
[email]gregersen@webshine.dk[/email]
Martin Gregersen Guest
-
.Net 2.0 : Smart tags and Readonly Collection Property
Hi, I've built a composite control with a ReadOnly custom collection property. I can manage collection items in the property editor with a... -
Composite Control Property Setting Problem
I have built a simple composite control that consists of a textbox, requiredfieldvalidator and rangevalidator. For properties that are unique to... -
Setting user control property dynamically?
Hi I created a user control that has a property that accepts a url ("NavUrl").. I tried to set the value as follows directly in the aspx page... -
Setting a control property
I have a custom composite control which reads in information from an XML file in its createchildcontrols() event. I would like to be able to set... -
Error Setting user control property at web form
Dear Friends Hope things goes well to you. I have this problem. Would you please give me your solution? I want to change a property that I... -
Masudur #2
Re: Dynamicly setting readonly in through a property
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
[url]www.kaz.com.bd[/url]
KAZ Software Ltd.
Software outsourcing made simple...
Martin Gregersen wrote:> 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
> [email]gregersen@webshine.dk[/email]Masudur Guest
-
Martin Gregersen #3
Re: Dynamicly setting readonly in through a property
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
[email]gregersen@webshine.dk[/email]
"Masudur" <munnacs@gmail.com> wrote in message
news:1164620045.129685.153710@l39g2000cwd.googlegr oups.com...> 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
> [url]www.kaz.com.bd[/url]
> KAZ Software Ltd.
> Software outsourcing made simple...
>
> Martin Gregersen wrote:>>> 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
>> [email]gregersen@webshine.dk[/email]
Martin Gregersen Guest



Reply With Quote

