Click here to Skip to main content
13,288,104 members (51,415 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Can I use ajax toolkit with web user control?
I wrote this code to give a mask to a textbox "TxtPrezzoUnitario" with MaskedEditExtender but does not work
some more help

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="OpeFatturaDettaglioInsertModify.ascx.vb" Inherits="PrjFattureWeb.OpeFatturaDettaglioInsertModify" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
    <asp:Panel ID="PanelFattura" runat="server">
            <table class="table">
                    <td class="defaultLabel">Prezzo Unitario</td>
                    <td class="td_right">

                        <asp:TextBox ID="TxtPrezzoUnitario" CssClass="input text" runat="server" MaxLength="15"></asp:TextBox>
                        <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender4" runat="server" TargetControlID="TxtPrezzoUnitario" Mask="9999.99" MaskType="Number"
Posted 24-Sep-12 5:18am
Updated 24-Sep-12 22:23pm
Sandeep Mewara 24-Sep-12 10:26am
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


If your objective is only to filter a valid character input...

try this if could help:

<ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender1" runat="server" xmlns:ajaxtoolkit="#unknown">
TargetControlID="TxtPrezzoUnitario" ValidChars="0123456789" FilterMode="ValidChars" />

Hope this could help.

edoandria 25-Sep-12 3:22am
thanks for your solution but i want use MaskedEditExtender because i have a number with two decimal.
thanks anyway
Al Moje 1-Oct-12 20:14pm
Ypou may add perion in Valid ValidChars and it will works.
e.g.: ValidChars="0123456789."
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I recorded AjaxControlToolkit in web.config.
In the master page I put the ToolkitScriptManager
In this configuration the MaskedEditExtender in "web user control" works correctly

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171207.1 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100