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  |  

  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
 


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.

 


PointClick.Net DNN Solutions
DotNetNuke Hosting Platform for Business and personal use.
PointClick.Net Hosted Solutions
Advanced Web Portals by Infoscaler
Infoscaler is a California based company that provides advanced Web Portals, E-commerce Sites, Database Applications and Intranet Solutions on the DotNetNuke and Microsoft.NET platforms.
www.infoscaler.com
DotNetNuke® in Sweden
All service of DotNetNuke® in Sweden.
Olsmar Konsult

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