CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 10/10/2003 10:34:16 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 29 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
glosh
Asp.Net User
setting user control property programmatically10/10/2003 10:34:16 AM

0/0

Hi,

I am trying to set the value of a user controls property from another user control.

I am using the following code to set the property:

stage = Page.FindControl(_NextStage)
stage.ctID = intctID


The control referenced as "stage" exists and is on the same parent page.

I am getting the following compliation error:

BC30456: 'ctID' is not a member of 'System.Web.UI.Control'.

I have declared the ctID properyt with the following code:


Private _ctID as integer
Public Property ctID as integer
Get
return _ctID
End Get

Set
_ctID = value
viewstate("VS_ctID") = value
lblTest.Text = value.toString()
End Set
End Property


What have I missed here, do I have to do something different when declaring user control properties to be able to access them from other controls?

Cheers
Glosh



tinghaoy
Asp.Net User
Re: setting user control property programmatically10/13/2003 1:07:21 AM

0/0

The problem is that the returned type of FindControl is Control (System.Web.UI.Control), you need to cast the type of stage to be the exact type of your stage object.

HTH,
Ting-hao
This posting is provided "AS IS" with no warranties, and confers no rights.
glosh
Asp.Net User
Re: setting user control property programmatically10/13/2003 7:42:54 AM

0/0

ah, thanks for that!

casting stage to type "object" fixes the problem.

CHeers
Glosh
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Debugging ASP.NET Authors: Jonathan Goodyear, Brian Peek, Brad Fox, Pages: 376, Published: 2001
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
MCAD/MCSD: Developing and Implementing Windows-Based Applications with Visual Basic. Net and Visual Studio. Net Authors: Mike Gunderloy, Ed Tittel, Pages: 1109, Published: 2003
MCAD Developing and Implementing Web Applications with Microsoft Visual C#(TM) . NET and Microsoft Visual Studio(R) . NET Exam Cram 2 (Exam Cram 70-315): Exam Cram 2, McAd Exam 70-315 Authors: Kirk Hausman, Amit Kalani, Ed Tittel, Pages: 600, Published: 2003
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Building Web Applications with C# and .NET: A Complete Reference Authors: Dudley W. Gill, Pages: 718, Published: 2002
Mastering ASP.NET with C# Authors: A. Russell Jones, Pages: 816, Published: 2002
ASP.NET: Tips, Tutorials, and Code Authors: Scott Mitchell, Pages: 878, Published: 2002
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators Authors: Sue Mosher, Pages: 825, Published: 2007

Web:
Advanced Basics: Set Word Document Properties Programmatically The application must allow the user to leave selected properties unchanged. ... Set up control property bindings: titleTextBox.DataBindings. ...
Microsoft ASP.NET QuickStarts Tutorial Introduction to User Controls Exposing User Control Properties Encapsulating Events in a User Control Creating User Controls Programmatically ...
Programmatically Loading User Control AND Setting Properties - ASP ... Programmatically Loading User Control AND Setting Properties. Last post 08-18- 2004 1:24 PM by ackweb. 7 replies. Sort Posts: ...
DotNetJunkies :: The #1 .NET Community for Developers Re: Access User Control Properties Programmatically Posted: 26 Apr 2004 02:26 PM . Actually i didn't get any error but also i couldn't set any value for the ...
Programmatically add usercontrol and storyboard : The Official ... Create two DoubleAnimations and set their properties. ... 07-06-2008 1:10 PM. Re : Programmatically add usercontrol and storyboard ...
TheMSsForum.com >> Asp >> Programmatically Set SkinId Properties ... Best regards Tag: Programmatically Set SkinId Properties For Controls Within UpdatePanel? Tag: 496294. 12 ยท user control event bubble hey all, ...
Setting Chart Properties Programmatically Talk about Setting Chart Properties Programmatically. ... User Control Panel, Private Messages, Subscriptions, Search Forums, Forums Home ...
How can I set properties for a usercontrol in windows? Color is set to blue and Text is set to This is a sample. ... To manipulate user control property values programmatically ...
Programmatically Working with User Controls Jan 6, 2005 ... This article showed you one way to programmatically work with user controls by dynamically setting their properties based on a querystring ...
Set 'RunAs' property programmatically for WinForms VB.Net applicat ComboBox DroppedDown property bug. If set in constructor, ... How to get the Windows user and group names. ... transparent user control ...

Videos:
Developing JavaScript with Chickenfoot Google TechTalks July 25, 2006 Rob Miller Michael Bolin ABSTRACT Chickenfoot is a Firefox extension that embeds a JavaScript programming environmen...




Search This Site:










code behind - sample files?

error creating control - textbox1 bad il format

md5 hash

french speaking dnn developper needed ! recherche expert dnn

createuserwizard

existence of skins

change default page size on photos.aspx for jeremy wadsworth starter kit

advantages of upgrading to .net

show an explicit message when change password fail

link in a skin object

struggling with whether to call dispose() on sqlcommand and sqlconnection

infragistics controls

gallery module

events raised from dynamic user control inside webpart becoming "lost"

problems serializing webcontrol to xml using xmlserializer

validate against ad or database depending on user's domain

help needed by creating a new user

treeview navigation

trouble getting profile information

this is ridiculous, i'm done with microsoft.t

column issues with 3 modules wide, need lower module to stretch across all three

more glitches with css files

strange problems..

"master pages" for user controls

dnn 3.06 file manager decompress zip

error installing dotnutnuke 3.2.2

cannot change items in options -> preferences

delete the home tab

dotnetnuke upgrade error

error when deleting a portal

 
All Times Are GMT