Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Ajax
Hi,
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
thanks
Eduardo
 
<%@ 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>
<center>
    <asp:Panel ID="PanelFattura" runat="server">
 
            
            <table class="table">
                                <tr>
                    <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"
                                DisplayMoney="Left"
                                ErrorTooltipEnabled="True">
                        </ajaxToolkit:MaskedEditExtender>
 
                    </td>
                </tr>
Posted 24-Sep-12 4:18am
Edited 24-Sep-12 21:23pm
v3
Comments
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
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
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" />
</ajaxtoolkit:filteredtextboxextender>
 
Hope this could help.
 
Regards,
  Permalink  
Comments
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
good
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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 383
1 Richard Deeming 180
2 Sergey Alexandrovich Kryukov 171
3 Yogesh Kumar Tyagi 165
4 ChauhanAjay 156
0 Sergey Alexandrovich Kryukov 6,252
1 OriginalGriff 5,498
2 CPallini 2,473
3 Richard MacCutchan 1,627
4 Abhinav S 1,530


Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2014
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