Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2015, 02:33 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default Make user control display property values at design time?

Changing the Text property of a text box in the VS IDE makes the text appear in the test box control in the IDE at design time. So, I have created a user control containing a text box, adding a Prompt property to the control's codebehind to set the Text property of the text box. As expected, the text box displays the value entered in the Prompt property at run time .

But, changing the Prompt property in the VS IDE on the page where the control has been consumed does not change the text box's text at design time. What do I need to do to get the value entered in the Prompt property in the VS IDE to appear in the user control (not the property pane!) at design time? Is this simply not possible?
 
Old June 10th, 2015, 03:59 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This is by design; as far as I know, the UC never responds to properties set in the grid for the control on the parent page.

If this behavior is important, you could build your own server controls. They have limited design time capabilities that may get you far enough. You can also associate control designers with them which give you the full experience that other, built-in controls have too: https://msdn.microsoft.com/en-us/magazine/cc302014.aspx

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old June 10th, 2015, 08:54 AM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Nah - it would just be helpful distinguishing between different instances of the control on the same page during design. Thanks, Imar!




Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox control Display property begaspnet BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 2 July 1st, 2014 09:12 AM
custom Property Enable & Disable in user control tiks C# 1 August 20th, 2008 09:31 AM
User Control Name in a Text Property laslanid Pro VB.NET 2002/2003 0 February 24th, 2005 04:31 AM
Setting Design time property in webcustom control c_cicilia ASP.NET 1.x and 2.0 Application Design 1 September 23rd, 2004 10:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.