Input Value Error

Hi.
How can i get input value ? when I try it: var WhatEmail = CustomerEmail.Value; show me error

My Xaml:

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:inputLayout="clr-namespace:Syncfusion.XForms.TextInputLayout;assembly=Syncfusion.Core.XForms"
xmlns:maskededit="clr-namespace:Syncfusion.XForms.MaskedEdit;assembly=Syncfusion.SfMaskedEdit.XForms"
x:Class="InvoiceMPG.Pages.ReceiptPageAdd">
<ScrollView>
<StackLayout>
<StackLayout Padding="10,2,10,2">
<!--Email-->
<inputLayout:SfTextInputLayout
Hint="Email"
OutlineCornerRadius="8"
FocusedColor="DarkCyan"
UnfocusedColor="Gray"
Padding="5,0,5,0"
InputViewPadding="6"
ContainerType="Outlined">
<maskededit:SfMaskedEdit x:Name="CustomerEmail" Keyboard="Email" Mask="\w+@\w+\.\w+" MaskType="RegEx" ClearButtonVisibility="WhileEditing"/>
</inputLayout:SfTextInputLayout>
</StackLayout>
</ScrollView>
</ContentPage>

My Code Behind:

using System;
using Xamarin.Forms;

namespace InvoiceMPG.Pages
{
public partial class ReceiptPageAdd : ContentPage
{
public ReceiptPageAdd()
{
InitializeComponent();
LoadCustomers();
}

private async void LoadCustomers()
{
          var WhatEmail = CustomerEmail.Value;
await DisplayAlert("OK", CualEmail, "Ok");
}
}
}


3 Replies 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team December 2, 2020 01:39 PM UTC

Hi EDGAR GARCIA,

Greetings from Syncfusion.

We have checked the reported problem with you provide code snippet, it has been worked fine without facing any error.  Could you please share the faced problem while getting the value of MaskedEdit which is placed inside the TextInputLayout to analysis more and provide a possible solution?

For your information, SfTextInputLayout is just a container, so getting its content reference doesn’t make a error in your application.

Moreover, we have shared other possible way to get the Value of MaskedEdit 
 
By set the Value property through Binding, you can access the binding property to get the updated value  
In your code snippet, you have display the CualEmail value in display alert but no more definition in your code. Could you please check whether because of that only , are you getting this error?

Please find the sample with your provided code snippet

https://www.syncfusion.com/downloads/support/forum/160235/ze/MaskSample-1258776870

Regards,
Sridevi S.
 


Marked as answer

EG EDGAR GARCIA December 2, 2020 04:40 PM UTC

Done, thanks


RS Ramya Soundar Rajan Syncfusion Team December 3, 2020 05:29 AM UTC

Hi EDGAR GARCIA, 
 
Thanks for your update. 
 
Please get in touch with us if you would require any further assistance. 
 
Regards, 
Ramya S 


Loader.
Up arrow icon