-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #739 from riganti/fix/location-fallback-page-rewrite
Fix LocationFallback overwriting the entire page on postback
- Loading branch information
Showing
9 changed files
with
136 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/DotVVM.Samples.Common/Controls/ResourceRequiringButton.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using DotVVM.Framework.Binding; | ||
using DotVVM.Framework.Controls; | ||
using DotVVM.Framework.Hosting; | ||
|
||
namespace DotVVM.Samples.BasicSamples.Controls | ||
{ | ||
public class ResourceRequiringButton : Button | ||
{ | ||
public string ResourceName | ||
{ | ||
get { return (string)GetValue(ResourceNameProperty); } | ||
set { SetValue(ResourceNameProperty, value); } | ||
} | ||
public static readonly DotvvmProperty ResourceNameProperty | ||
= DotvvmProperty.Register<string, ResourceRequiringButton>(c => c.ResourceName, null); | ||
|
||
|
||
protected override void OnPreRender(IDotvvmRequestContext context) | ||
{ | ||
if (context.IsPostBack) | ||
{ | ||
context.ResourceManager.AddRequiredResource(ResourceName); | ||
} | ||
base.OnPreRender(context); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/DotVVM.Samples.Common/Views/FeatureSamples/Resources/RequiredOnPostback.dothtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@viewModel object | ||
|
||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>Resource required on postback</title> | ||
</head> | ||
<body> | ||
<h1 data-ui="welcome">Welcome</h1> | ||
<cc:ResourceRequiringButton Text="Click on me!" | ||
ResourceName="FeatureSamples_Resources_RequiredOnPostback" | ||
Click="{command: 0}" | ||
data-ui="button"/> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.