Click here to Skip to main content
11,641,971 members (61,961 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET Ajax
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 4:18am
Edited 24-Sep-12 21:23pm
Sandeep Mewara at 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 at 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 at 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
0 DamithSL 285
1 Sergey Alexandrovich Kryukov 159
2 Afzaal Ahmad Zeeshan 145
3 OriginalGriff 110
4 Mika Wendelius 90
0 Mika Wendelius 460
1 DamithSL 353
2 OriginalGriff 315
3 Sergey Alexandrovich Kryukov 179
4 Afzaal Ahmad Zeeshan 169

Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2015
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