Forum
smartDBforms.NET for ASP.NET 2
 
 
Knowledge Base Forum
To post messages on the forum, you need to login first.
SearchForum Home
  Product Forums  smartDBforms.NET  SelectTemplateI...
 SelectTemplateID function
 
 2/6/2007 11:37:32 AM
George
1 posts


SelectTemplateID function

I added one additional Templateholder "PasswordTmplt" to the TemplatesStorage.ascx file and extended the SelectTemplateID function. My code checks the column name for special text and returns the id of the new temlpateholder:
Here is the code:
        if ((typeof(string)) == dataBindItem.DataType
            && dataBindItem.FieldName.Contains("Password"))
            return "PasswordTmplt";
But when I run the SmartDBView form,  another template is used instead. My code seems to not be processed in some way

George.
 2/7/2007 3:10:20 PM
Adillis Support
27 posts
adillis.com


Re: SelectTemplateID function
Hi George,

First you should make sure that inline template selection is used. By default the standard smartDBtemplates template set uses precompiled template selection. When precompiled template selection is activated the SelectTemplateID method is not invoked at all.
To enable inline template selection open TemplatesStorage.ascx and delete the value for the TemplateSelectorType property of the TemplatesControlCenter web server control.

Also notice that the position of your code in the SelectTemplateID method is important. For example if you place your code at the end of the method it will be never executed because the more generic code for "StringTemplate" will match first.

For more information on template selection you can read the Template Selection documentation.

If you have any other questions, we will be more than happy to help you.

Best wishes,
Adillis Support
Adillis - IT solutions
http://adillis.com
  Product Forums  smartDBforms.NET  SelectTemplateI...
Copyright 2006-2008 Adillis Terms Of Use Feedback Contact Us