Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / March 2006

Tip: Looking for answers? Try searching our database.

Usercontrol enable property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
greatdane - 22 Mar 2006 22:01 GMT
I have a usercontrol with a textbox.
I displayed the control programmatically on my .aspx

How could I manipulate the 'enable property' and/or bordercolor  of the ucl
textbox from my .aspx page?
Steve C. Orr [MVP, MCSD] - 22 Mar 2006 22:33 GMT
The simplest way is to declare the textbox as public (instead of the default
of private).
You may be able to do this by setting its Modifiers property.

Here are more details about best practices on this subject:
http://SteveOrr.net/faq/PassDataToUserControl.aspx

Signature

I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

>I have a usercontrol with a textbox.
> I displayed the control programmatically on my .aspx
>
> How could I manipulate the 'enable property' and/or bordercolor  of the
> ucl
> textbox from my .aspx page?
greatdane - 23 Mar 2006 21:49 GMT
This helped me... Thanks
In addition I am trying to create on my page an array of 4 strings
containing the name of 4 textboxes from my control.
Dim a(4) as string
a(0) = "txtCrownofroad"
a(1) = "txtcntyfld"
a(2) = "txtreviewzone"
a(3) = "txtreviewbfe"
Dim x As Integer

  For x = 0 To a.Length
           CType(ctlFReview_entry.FindControl(a(x)), TextBox).ReadOnly =
False
           CType(ctlFReview_entry.FindControl(a(x)), TextBox).BorderColor =
Color.SteelBlue
       Next
I am getting an error because it is not reading '.FindControl(a(x))...

> The simplest way is to declare the textbox as public (instead of the default
> of private).
[quoted text clipped - 9 lines]
> > ucl
> > textbox from my .aspx page?
Steve C. Orr [MVP, MCSD] - 23 Mar 2006 22:33 GMT
What is the error you are getting?

> This helped me... Thanks
> In addition I am trying to create on my page an array of 4 strings
[quoted text clipped - 29 lines]
>> > ucl
>> > textbox from my .aspx page?
greatdane - 24 Mar 2006 15:27 GMT
I did not write the error down; however, reading a little further from the
article the you referenced before, I decided to implented the code as follow:
It is a better approach.  Thanks for your help!!
For Each Panel2_Control As Control In Panel2.Controls(0).Controls
           If TypeOf Panel2_Control Is TextBox Then
               CType(Panel2_Control, TextBox).ReadOnly = False
               CType(Panel2_Control, TextBox).BorderColor = Color.SteelBlue
           End If
       Next

> What is the error you are getting?
>
[quoted text clipped - 33 lines]
>
> .

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.