How to debug Sitefinity MVC Widget - sitefinity

I am trying to debug a MVC widget in sitefinity 8 but the debugger doesn't hit the breakpoint. The widget works but I cannot debug it. What is wrong? It seems like sitefinity compiles the widget first then renders the compiled one at run time. Am I right? How can I get to breakpoint?
Edit:
The debugger actually hit the breakpoint if the code is inside controller. But I cannot debug into view's (cshtml file) code.

Sitefinity is caching your views. If you want to debug the view, make sure to let the breakpoint hit it the very first time.

He Behrooz,
you can turn off the Caching for the page you drag widget:
Page -> click on "Action" -> "Titles and Properties" -> scroll down to "Advance Tab" -> add choose Caching Options is "No Caching".
You can see the image attachment for more details.

Related

Telerik Kendo UI for ASP.NET Core Add/Edit Popup window title and button text change

I am working project that use Kendo UI and I am new to it.
I have been searching whole day for this simple implementation- I need to change the popup window title and button text based on edit mode or add mode.
Here is the latest answer I found: forum
Above link has exact same question I have. But the solution is not working for me.
I tried to use e.Edit() on Events. But it throws an error:
"DataSourceEvenBuilder" does not contain a definition for Edit and no accessible extension method "Edit"
And the e.model is undefined as well
From official page, I don't see Edit method.
Can anyone help? Please don't provide the solution that build grid from javascript.
Telerik version: ASP.NET Core 2022.1.301

Overlay Drop down issue

While clicking the dropdown in an overlay, it shows the list as expected and the main page gets hided. But when the user tries to scroll on the page, the dropdown content (list) start moving along the page scroll.
We used Dojo 1.8 for our HTML development. Can anyone help me with a suggestion to handle this?
It's not 100% clear from your question, but I believe you are describing https://bugs.dojotoolkit.org/ticket/5777. As far as I can tell, the resolution to this for moving popups along with their opener's container's scroll was only institituted in 1.9 and above (I couldn't find the _repositionAll method in 1.8).
I would suggest trying with 1.9.7 or 1.10.4.

Removing Ektron widget

I believe there is a widget on my page that is causing unbelievably slow page loads. I have narrowed down the exact page it is, and I have about 8 widgets on it. I am trying to disable the widgets one by one, but am having a tough time figuring it out. In the documentation to explains how to remove a widget, but I would like to only temporarily disable them.
These widgets are on PageBuilders, and I have tried to deselect them in Settings > Configuration > Template Configuration but this does not seem to disable it.
Is there a different way to disable widgets?
I am using Ektron 8.6.1
To disable the widget, you could remove the .ascx file from the /widgets folder. The Page should open but report "Cannot load widget" where that widget would appear on the page.
The template configuration setting only prevents you from adding that widget to a new page.

Sitefinity - How to add link to internal page

I'm new to Sitefinity. So far I see some built in widgets to add image and text and let other edit them later on. However, I want to build a block which contains an image, a short description and when click that block will jump to an internal page. I'm stuck at figuring out how to make the internal URL editable.
Anybody has experience about this?
Thank you

How can I remove pages from a Frame's history?

How can I manipulate a Frame's history in a WinRT XAML app?
The user will start on my hub page, where they can select an existing project to go to its edit screen, or they can select "new project". "New project" will take them through a short wizard, then take them to the "edit project" screen.
It makes sense for the wizard pages to just be pages that I navigate to in the frame; that way the user can back out of the wizard if they change their mind. (It'll only be two pages, so "back" can take the place of "cancel".) But once the wizard is done and the changes are committed, there's no longer any reason for those wizard pages to be in the history; if the user clicks Back from the "edit project" page, I want them to go right back to the hub.
To illustrate, I want the flow to look something like this:
Frame history: Hub. User clicks "New Project".
Frame history: Hub -> Wizard Page 1. User clicks "Next".
Frame history: Hub -> Wizard Page 1 -> Wizard Page 2. User clicks "Finish".
Frame history: Hub -> Edit Project.
Frame doesn't seem to have any methods along the lines of "remove from history". The docs do have hints that there might be some way to override the history, because the docs for GoBack say "Navigates to the most recent item in back navigation history, if a Frame manages its own navigation history" (emphasis mine), but that's all it has to say on the topic -- there's no mention of how someone else can manage history for it. So I don't know whether that's useful or not.
How can I remove my wizard pages from my Frame's history once the user completes the wizard?
You can remove pages from the history by calling SetNavigationState(string navigationState) on the frame. Unfortunately the format of the serialized navigationState is "for internal use only", so just changing the string might break your code in future versions.
I only can think of a future proof method to completely clear the navigation stack:
At program startup save the empty navigation state by calling GetNavigationState.
BEFORE calling Navigate for your Edit Project page, call SetNavigationState with the empty navigation state.
Your Edit Project page will now be the first page on the stack.
Starting with Windows 8.1, you have access to the BackStack property of a Frame. You can easily remove some content or clear the whole back stack.
Here is what I'm using the clear the back stack :
var rootFrame = (Window.Current.Content as Frame);
rootFrame.Navigate(typeof(MyPage));
rootFrame.BackStack.Clear();
its a solution for me :
while (ContentFrame.BackStack.Count > 1)
{
ContentFrame.BackStack.Remove(ContentFrame.BackStack.ElementAt(ContentFrame.BackStack.Count-1));
}