Change ASCX file content using SiteFinity web UI - sitefinity

We are using Sitefinity 6.0.
We have an end user that would like to make changes to the header custom control in:
C:\inetpub\xxx\App_Data\Sitefinity\WebsiteTemplates\xxx\UserControls\Header.ascx
We would like the end user to be able to make changes to the file using the SiteFinity web, instead of opening the file in Windows and editing it directly.
Is it possible? What with Sitefinity 7.0?

There is an option to register the templates of custom controls so that they can be edited through the UI. This blog posts explains the process: http://www.sitefinity.com/blogs/slavo-ingilizovs-blog/2012/09/21/making-your-widget-templates-editable-through-the-ui.
However if you are using user controls you will not be able to use this method. This approach works with custom controls. You can find more about different types of widgets (user controls vs. custom control) here: http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/controls.

To change the html markup of the UserControl you can simply go to the File manager from the Sitefinity backend (Administration -> File Manager).
If it is codebehind code, you will need to recompile your solution, so you can't do this on the fly.
If you need to set properties, use the solution that Ben mentioned in his comment.

Related

How to override default WinUI 2.x styles in Blend?

Previously I had asked where to find the default styles for the WinUI 2.x controls, and was pointed to the appropriate repository in GitHub where those could be found. Thanks! However, what I really want is to be able to override some of the styles. I was expecting that I would be able to do so in Blend, but I have not been able to figure out how to do that.
For example, when I load my project in Blend and then try to edit the templates for the ContentDialog, I am offered the option to apply an existing style, but not to create a new one. I was expecting I could create a copy, which would give me the default styling as a starting point and allow me to make the small modifications I require. Regarding buttons, I was able to edit a copy of the template, but that only gave me access to the ControlTemplate where I want access to the equivalent of DefaultButtonStyle.
It has been a while since I've used Blend, so perhaps I am mis-remembering how the tool works. But in previous versions of our app I was able to generate resources that included the full styling of the controls that I was using, such as buttons and content dialogs. Can I do the same for our current app that uses WinUI 2.x? If so, how? And if not, what are my alternatives? I have considered copying the default templates I am interested in into the resources of my project and making modifications that way, but I am hopeful that there is a better way.
Rich
I am offered the option to apply an existing style, but not to create a new one
This is expected. For example, both the Visual Studio or the Blend for Visual Studio can't directly create a default DropDownButton style of WinUI. You need to manually copy the WinUI style from Github and put the style in your XAML.
For native UWP controls, you could just generate a copy of the style automatically.

What is the difference between the designer.vb page and .vb page?

I am new to framework 3.5. I noticed that when creating a web content form, it creates a aspx.designer.vb page in addition to the aspx.vb page. Can anyone explain the difference to me and the purpose of each?
Can anyone explain the difference to me and the purpose of each?
aspx.designer.vb
Is the designer related autogenerated code by the framework and it contains necessary code for the controls you have placed in your form in designer surface. If you want you can make changes to your controls look and feel using the desinger property window (or) even using this designer file.
aspx.vb is the file where the actual server side code block is present. Like your controls event handler methods etc.
consider going through the MSDN documentation for getting a better understanding on the same.
I have noticed it too..
I think the .vb file has the code you have written.. and the designer.vb file has options on how to display your code in the screen..
You can open the files with Visual Studio or NotePad++ or just Notepad to see the difference..

Better way to add custom controls to your project

There are groups of customized user-interface components, freely available for VS 2010 Express. They are called "themes". Here you have a video showing how these themes can be added to a VB project:
http://www.youtube.com/watch?v=Ec9GZaPMGqE
I would like to be able to apply a "theme" to my already existing application, but doing so would require me to manually replace all the elements in my form with the newly imported ones. Is there a better way to do this?

How to debug custom ASP.NET MVC Text Templates?

How do you go about debugging the T4 process when you are customizing the template?
I've followed the procedure in Hanselman's post to add the templates to my project so that is uses them when using the Tooling Dialog but how to I debug that template when it uses it? The documentation here and here is not really helpful since I've cleared out the Custom Tool property.
For example, I'm trying to customize the List.tt and I'd like to loop through the properties of the Model inside the Index method. I'd like to have a look at what's hanging off the Model object, etc.
My current process is edit the List.tt, right-click on controllers folder, add Controllers, enter the name, select my model, choose 'Overwrite xxxController.cs' and then check to see if what I did worked. This is extremely tedious.
Why not put the custom tool property back in to be able to rapidly test it? then take it out when you are happy?
another option is to write a .tt file that consumes/includes that .tt to operate as your REPL harness

Display files in a directory list control

Is there a way for user to select a specific file using BrowseDlg? All i can find is that you can select only a folder!! I believe File selection is one of the "common" functionality in use.
Can anyone provide some suggestion on how this can be achieved.
Thanks!
Update
I am thinking of creating a C# custom aciton for this, as all other CA in project are in C#. But I am not sure about few things....
How can I sequence this CA dialog with my exsiting UI sequence.
How to trigger a CA on a button click from one of my custom dialog.
How to get the file path back from File Browse CA to be further used by WIX.
The other CAs that I have created does not have any UI associated.
Please advice.
Thanks!
Actually, Windows Installer doesn't have anything built-in for the "Browse for file" dialog. Various vendors offer their custom solutions, like Advanced Installer and InstallShield.
Anyway, this all ends up in a custom dialog and custom action for Browse button. You can find an example of this here (search for "File Browse Dialog" on that page). The package you'll find contains the custom action, sample solution and some notes. It is based on InstallShield, but you can take at least custom action from there (creating a custom dialog in WiX is not that hard). As a last resort, you can try to implement this CA yourself.