Problem with template RRS feed

  • Question

  • User1885169913 posted

    I am using this sample code: http://msdn.microsoft.com/en-us/library/ms178657(printer).aspx. That works well but when in Visual Studio 2008 and I choose to edit the template I am only able to drag and drop server controls like a button or literal control from the toolbox in it.

    1) I am not able to type in regular text or so which I would expect to be possible. How come?

    2) I see a Item in the combobox of the desigener when in template editing mode. Why is this?

    3) I have the Title and Caption set. If I add a literal control and look at the properties I can set the Text. However how can I bind to either Title or Caption property? Now I have to do in source view and then when switching to Design mode again I can see a little yellow shape and when I hover over it, it provides the tooltip "Property is databound". How can I do this via the designer?

    Tuesday, October 6, 2009 4:57 AM


  • User544512917 posted

    In answer to your questions:

    1) If you want to change the text that appears on a UserControl, go into the .ascx file where it is defined. A template by definition does not allow the addition of text outside of a subcontrol.

    [EDIT: In this case, the control is a server-side control defined in a .cs file. So the modification to the displayed text would need to go in that file. There is no designer available for such a control.]

    2) Item seems to be what the designer calls the default template.

    3) There does not seem to be any way to databind controls from the designer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 12, 2009 9:01 AM