Mar 24, 2016, 6:00 PM
Use Bind and BindString simultaneously
On the following example, Text property has a fixed value (line 20) and FieldLabel property is bind to ViewModel (line 22).
Thanks in advance.
<script runat="server">
public class MyModel
{
public static object Model = new
{
data = new
{
title = "Raphael",
description = "Saldanha"
}
};
}
</script>
<html>
<head runat="server">
</head>
<body>
<form runat="server">
<ext:ResourceManager ScriptMode="Debug" runat="server" />
<ext:TextField ViewModel="<%# MyModel.Model %>" Text="Fixed Text" AutoDataBind="true" runat="server">
<Bind>
<ext:Parameter Name="fieldLabel" Value="{title}" />
</Bind>
</ext:TextField>
</form>
</body>
</html>
It's also possible to bind both Text and FieldLabel (lines 22 and 23)<script runat="server">
public class MyModel
{
public static object Model = new
{
data = new
{
title = "Raphael",
description = "Saldanha"
}
};
}
</script>
<html>
<head runat="server">
</head>
<body>
<form runat="server">
<ext:ResourceManager ScriptMode="Debug" runat="server" />
<ext:TextField ViewModel="<%# MyModel.Model %>" AutoDataBind="true" runat="server">
<Bind>
<ext:Parameter Name="fieldLabel" Value="{title}" />
<ext:Parameter Name="value" Value="{description}" />
</Bind>
</ext:TextField>
</form>
</body>
</html>
But when BindString is used simultaneously with Bind, only Text property (BindString) is bind correctly.<script runat="server">
public class MyModel
{
public static object Model = new
{
data = new
{
title = "Raphael",
description = "saldanha"
}
};
}
</script>
<html>
<head runat="server">
</head>
<body>
<form runat="server">
<ext:ResourceManager ScriptMode="Debug" runat="server" />
<ext:TextField ViewModel="<%# MyModel.Model %>" BindString="{description}" AutoDataBind="true" runat="server">
<Bind>
<ext:Parameter Name="fieldLabel" Value="{title}" />
</Bind>
</ext:TextField>
</form>
</body>
</html>
Is that the expected behaviour?Thanks in advance.
Last edited by RaphaelSaldanha; Mar 24, 2016 at 6:15 PM.