Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
WebHostForAsp.net
 


  Sponsors  

Meet Our Sponsors

Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Controls on controls
Previous Previous
 
Next Next
New Post 1/17/2006 11:33 AM
User is offline steve conard
95 posts
10th Ranked


Controls on controls 
I have two controls in a custom module.  Control 1 is view. Control2 is search.  User selects value on Control2 and I want to update Control1(View).  I cannot find syntax to change values on Control1 from Control2.  The following is function on Control1 that is called from Control2 after pageInit and load on Control1.  I have tried many many ways to findControl but all fail.

'Function on Control1 called from Control2 after Control1 PageInit/load:

        Public Function loadformValues(ByVal intValue As Int32)

            Dim objControl as Control1 = Page.FindControl("Control1")
            Dim tb As New TextBox
            tb = objControl.FindControl("tbsecure_lastname")' fails at finding textbox on Control1
            tb.Text = intValue 

        End Function

Thank you for any assistance

 
New Post 1/27/2006 9:09 AM
User is offline Charles Nurse
2769 posts
5th Ranked










Re: Controls on controls 
A better way to do this is to create a Public Property in Control1 called SecureLastName (which is a wrapper for the text box's text property) for example

Public Property SecureLastName as String
    Get
       Return tbsecure_lastname.Text
    End Get
    Set (Value as String)
      
tbsecure_lastname.Text = Value
    End Set
End Property

And then modify the code in Control2

       Public Function loadformValues(ByVal intValue As Int32)

            Dim objControl as Control1 = Page.FindControl("Control1")
           
objControl.SecureLastName = intValue 

        End Function

If you need to expose all the properties of the control expose the control as a Property

Public ReadOnly Property SecureLastName as TextBox
    Get
       Return tbsecure_lastname
    End Get
End Property

This will allow you to do the following

       Public Function loadformValues(ByVal intValue As Int32)

            Dim objControl as Control1 = Page.FindControl("Control1")
           
objControl.SecureLastName.Text = intValue 

        End Function




Charles Nurse
DotNetNuke Trustee,
Senior Architect, DotNetNuke Coporation
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
See my Blog for Articles on .NET, DNN and Module Development

View my Blog
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Controls on controls
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DNN Outsourcing
50% more affordable services comparing to Western Europe and US: Custom DotNetNuke module development, skins, consulting, maintainence... Over 15.000 working hours of experience in custom DotNetNuke Solutions development, 8 years experience in outsourcing, excellent references!
www.dnnoutsourcing.com
Expressnet - DotNetNuke Hosting
Expressnet provide premium quality ASP.NET Web Hosting. We specialise in Windows based products including ASP.NET and Microsoft SQL Server. We offer fantastic value packages for DotNetNuke hosting. We also offer free asp.net web hosting
www.expressnet.com.au
Softech Development, Inc.
We help your business work smarter with DotNetNuke. Whether you need a new implementation, a custom module or skin for an existing implementation, or integration with your business processes, Softech has the experience and expertise to make it happen.
www.softechdevelopment.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP