Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all 5678 articles
Browse latest View live

Expanding Panel with CollapsiblePanelExtender

$
0
0

I've setup a Panel that contains 5 buttons.  The Panel is collapsed so you only see ButtonUserAdd, ButtonGroupAdd and ButtonExportPermissions.

Based on code behind the Panel expands with ButtonUndo and ButtonSave appearing, what I don't understand is why when these buttons are before ButtonExportPermissions they appear on one line and are formatted wrongly.  However if they are after ButtonExportPermissions they appear fine.  Is there something I can do to fix this?

<asp:Panel ID="panelTasksContent" runat="server" CssClass="collapsiblePanelContent"
                        Width="146px" Wrap="False"><div id="divCbInherit" runat="server" style="display: inline"><asp:CheckBox ID="cbInherit" runat="server" Text="Inherit from parent" AutoPostBack="True"
                                OnCheckedChanged="cbInherit_CheckedChanged" Enabled="false" ToolTip="Turn folder inheritance on or off. Allow permissions to flow through from a parent folder or not." /></div><div align="left"><asp:Button ID="ButtonUserAdd" Style="background-image: url('Images/User.gif'); background-color: Transparent;
                                cursor: hand; background-repeat: no-repeat; background-position: left; padding-left: 15px"
                                runat="server" Height="25px" BorderStyle="None" Text="Add Users" Width="100px"
                                OnClick="ButtonAdd_Click" ToolTip="Add Users to this folder and subfolders depending on inheritence." /></div><div><asp:Button ID="ButtonGroupAdd" Style="background-image: url('Images/groups.gif');
                                background-color: Transparent; cursor: hand; background-repeat: no-repeat; background-position: left;
                                padding-left: 15px" runat="server" Height="25px" BorderStyle="None" Text="Add Groups"
                                Width="110px" OnClick="ButtonGroupAdd_Click" ToolTip="Add Groups to this folder and subfolders depending on inheritence." /></div><div id="divButtonUndo" runat="server"><asp:Button ID="ButtonUndo" Style="background-image: url('Images/undo.gif'); background-color: Transparent;
                                cursor: hand; background-repeat: no-repeat; background-position: left; padding-left: 15px"
                                runat="server" Height="25px" BorderStyle="None" Text="Undo Changes" OnClientClick="UndoChanges()"
                                ToolTip="Undo Changes." /></div><div id="divButtonSave" runat="server"><asp:Button ID="ButtonSave" Style="background-image: url('Images/save.gif'); background-color: Transparent;
                                cursor: hand; background-repeat: no-repeat; background-position: left; padding-left: 15px"
                                runat="server" Height="25px" BorderStyle="None" Text="Save" OnClientClick="SaveChanges()"
                                ToolTip="Apply Permissions to bolded folder and subfolders.  Depending on Inheritance." /></div><div><asp:Button ID="ButtonExportPermissions" Style="background-image: url('Images/export.gif');
                                background-color: Transparent; cursor: hand; background-repeat: no-repeat; background-position: left;
                                padding-left: 15px" runat="server" Height="25px" BorderStyle="None" Text="Export Permissions"
                                Width="150px" OnClick="ButtonExportPerms_Click" ToolTip="Will save a Tab delimited file containing the current permissions on the highlighted folder and subfolders." /></div></asp:Panel></asp:Panel><ajax:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" TargetControlID="panelTasksContent"
                    ExpandControlID="panelTasksHeader" CollapseControlID="panelTasksHeader" Collapsed="True"
                    ImageControlID="expandcollapse_tasks" ExpandedImage="~/images/collapse.gif" CollapsedImage="~/images/expand.gif"
                    SuppressPostBack="True" ExpandDirection="Vertical" CollapsedSize="100" ExpandedSize="150"/>

Update Panel doesn't refresh after AsyncPostBackTrigger rise

$
0
0

Hi:

  I have a problem when launching a AsyncPostBack Trigger programmatically. I mean...

  I have an UpdatePanel with an AsyncPostBackTrigger like this: <asp:AsyncPostBackTrigger ControlId="btnFilter" EventName="Click" />

  If I click on the button, the server code executes and the Update Panel refresh properly. But, when I click the button programmatically in a javascript method like this: $get('btnFilter').click, the server code runs perfectly, but the Update Panel doesn't refresh. The page is not Posted enterely, so the UpdatePanel works fine trying to refresh only himself, but the content, as I said before, doesn't refresh.

  I've also tried to include the button and the textbox (search criteria) inside the content panel, with the Children as trigger set to True and removing the AsyncPostBackTrigger, but it still happens the same.

  I have a seach textbox and a filter button on a page, and the update panel in a User Control. What I like to do is to refresh the Grid that is inside the Update Panel when clicking the filter button. On previously versions I used this method of refreshing the panel, but now it doesn't work... any suggestion?

  This is the code:

  Page1.aspx

function Buscar() {

            $get(controlfiltro).value = $get('MainContent_txtNombreCliente').value;

            $get(botonfiltro).click();

            $get('divBusqueda').style.display = '';

        }

 

function CerrarBusquedaNuevaSimulacion() {

            $get'divBusqueda').style.display = 'none';

        }

 

var controlfiltro = 'MainContent_ResultadoClientes1_txtFiltro';

var botonfiltro = 'MainContent_ResultadoClientes1_btnFiltrar';

 

<table border="0" cellpadding="0" cellspacing="0" style="margin: left; line-height: 20px;

                                width: 100%">

                                <tr>

                                    <td style="height: 5px">

                                    </td>

                                </tr>

 

<tr>

                                    <td align="right" valign="middle">

                                        <asp:Literal runat="server"ID="lblNombreCliente" Text="Name:" />&nbsp;

                                    </td>

                                    <td valign="middle">

                                        <asp:TextBox ID="txtNombreCliente"runat="server" CssClass="FormObligatorio" Width="200px"

                                            Text="Nombre Cliente" />&nbsp;&nbsp;

                                    </td>

                                    <td align="left">

                                        <img id="lupa" src="../img/lupa.gif"alt="Buscar" title="Buscar" style="height: 20px;

                                            vertical-align: middle; cursor: hand;" onclick="javascript:Buscar()" />

                                    </td>

</tr>

 

</table>

ResultadoClientes.ascx

<%@ Control Language="VB" AutoEventWireup="false"CodeFile="ResultadoClientes.ascx.vb"

    Inherits="Simulador_WebUserControl" %>

<%@ Register Assembly="Infragistics4.Web.v14.1, Version=14.1.20141.2150, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"

    Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>

<div style="margin-left: 40px; margin-top: 40px; vertical-align: middle;">

    <asp:UpdatePanel ID="updatePanel1" runat="server" ChildrenAsTriggers="False"UpdateMode="Conditional">

        <ContentTemplate>

            <ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="260px"Width="505px" AutoGenerateColumns="False"

                DataKeyFields="ClienteId" EnableAjax="True"EnableAjaxViewState="True">

                <Columns>

                    <ig:BoundDataField DataFieldName="ClienteId"DataType="System.String" Key="ClienteId"

                        Width="75">

                        <Header Text="Id Cliente" />

                    </ig:BoundDataField>

                    <ig:BoundDataField DataFieldName="NombreCliente"DataType="System.String" Key="NombreCliente"

                        Width="200">

                        <Header Text="Nombre Cliente" />

                    </ig:BoundDataField>

                    <ig:BoundDataField DataFieldName="NombreGrupo"DataType="System.String" Key="NombreGrupo"

                        Width="200">

                        <Header Text="Nombre Grupo" />

                    </ig:BoundDataField>

                </Columns>

                <AjaxIndicator ImageUrl="~/img/Cargando.gif" Enabled="True" />

                <Behaviors>

                    <ig:Selection CellClickAction="Row" RowSelectType="Single">

                    </ig:Selection>

                    <ig:Paging NextPageText="Siguientes 10&amp;nbsp;&amp;gt;"PageIndex="0" PageSize="10"

                        PagerMode="NextPrevious"PreviousPageText="&amp;lt;&amp;nbsp;Anteriores 10">

                    </ig:Paging>

                </Behaviors>

            </ig:WebDataGrid>

        </ContentTemplate>

        <Triggers>

            <asp:AsyncPostBackTrigger ControlID="btnFiltrar" EventName="Click"/>

        </Triggers>

    </asp:UpdatePanel>

    <br />

    <div style="text-align: right">

        <input type="button" class="Boton" id="btnCerrar" runat="server"value="Cerrar" />

        <input type="button" class="Boton" id="btnSeleccionar" runat="server"value="Seleccionar" />

    </div>

    <div style="">

        <asp:Button ID="btnFiltrar" runat="server" UseSubmitBehavior="true"Text="buscar" />

        <asp:TextBox ID="txtFiltro" runat="server" />

    </div>

    <br />

Server Code onResultadoClientes.ascx

Protected Sub btnFiltrar_Click(sender As Object, e As System.EventArgs) HandlesbtnFiltrar.Click

        Me.WebDataGrid1.DataSource = CrearDatos(Me.txtFiltro.Text)

        Me.WebDataGrid1.DataBind()

    End Sub

 

Regards

modal popup saving data problem

$
0
0

hi,

i have a web form that contains panel which is to be popup window. i have 1 textbox and save and cancel button inside panel. problem is when i click save button textbox.text is empty because the page_load event is fired before save_click event. my question is how to get to the data in textbox and save it in database.

here is my code:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"><cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true"></cc1:ToolkitScriptManager><cc1:ModalPopupExtender ID="extCountry" runat="server" PopupControlID="pnlNewCountry" TargetControlID="ibtnAddNewCountry" CancelControlID="btnCancel"></cc1:ModalPopupExtender><div>
	...<asp:Panel ID="pnlNewCountry" runat="server" style="display:none;width:301px;height:140px;background-color:#F4EFF0;padding-left:10px;padding-top:10px;border:solid;border-color:#75C60B;border-width:thin;"><asp:Label ID="lblNewCountry" runat="server" Text="New Country" CssClass="lblLong200"></asp:Label><asp:TextBox ID="txtNewCountry" runat="server"  CssClass="txtbox" ></asp:TextBox><div style="height:30px;"></div><div style="text-align:right;padding-right:10px;"><asp:Button ID="btnSave" runat="server" Text="Save"  CssClass="btn btn-defaultSave" OnClick="btnSave_Click()"   /><asp:Button ID="btnCancel" runat="server" Text="Cancel"  CssClass="btn btn-default" /></div></asp:Panel>
	...</div></asp:Content>


protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                Sif_DrzaveAcc acc = new Sif_DrzaveAcc();
                acc.Drzava_ins(txtStrano_mjesto_rodjenja.Text);

                LoadDrzava_rodjenja();
            }
            catch (Exception ex)
            {
                Code_folder.Util.ShowPopUpMsg(ex.Message, this.Page, this);
            }
        }

Ajax controls are inactive in content page - please help

$
0
0

Hey asp.net guys and gurus, good day. I desperately need help on my situation :-( I have Master Page (site.master), Web User Control (ucbuttons.ascx) that's being attached in Master page, and then a Content page (site1.aspx). Web User control and the content page are both containing ajax controls like calendarextender, watermark, modalpopupextender, etc.

During my test, if i'm going to attach the user control in the master page, ajax in user control are working normally, but ajax controls in content page wont work. but if i'm going to detach or disable user control from master page, ajax controls in the content page will work normally. It's like there's a conflict or something between web user control and content page but I cannot point out the cause od this. I've been struggling this for months, debug and check in the net for any solution but I can't find any similar scenarios like mine.

I really appreciate for some guys and gurus to shed some solutions on my situation.

Thank you very much.

Jim.

AJAX Tab Control

$
0
0

I've added a TabContainer with about a dozen TabPanel controls embedded in it. Only the first two Panels are clickable though, the other ten show up as tabs but when you hover over them or click on them nothing happens? Any thoughts on what would cause it or is the control just that buggy? Below is a like to a screenshot if that helps.

https://flic.kr/p/pJGKp8

Sean

Detailsview Update and Cancel buttons freeze out in Chrome

$
0
0

Hi,

A very strange thing is happening to a website that I built. I have a detailsview with several Ajax Toolkit editors and all was working fine until recently. Now when trying to update the information in the detailsview the Update and Cancel buttons don't do anything - but only sometimes. I chased it down and discovered that if the first character in any of the editors is a tag (in code view, not edit view) then the buttons won't work. I don't mean that the event isn't firing, I can't even click the buttons. It's not a sanitisation issue, I have it disabled and the editors will happily accept tags - unless it's the first character. Even stranger is that this behavior is in Chrome and Safari only but everything works fine in Firefox (I haven't tested IE). The toolkit version is 7.0123. Any help appreciated.

How to fetch and print to screen over 5000 Customer invoice without Timeout Or Server not responding on internet Connection

$
0
0

Hello,

Please i your professional advice and way to fetch and print to screen over 5000 Customer invoice with Timeout Or Server not responding on internet Connection.

Am working on billing web application which involve in fetch and print to screen over 5000 Customer invoice over the internet to print from the printer. but have been having problem of Timeout Or Server not responding on internet Connection.

Please help i need to get this right. both on slow and fast internet speed connection

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PrintInv2.aspx.cs" Inherits="PrintInv2" %><%@ Import Namespace="System.Data.SqlClient" %><%@ Import Namespace="System.Globalization" %><script language="C#" runat="server">
    private readonly SqlConnection _Cnndb = new SqlConnection(GetContent.ConnectDB());
    public DateTime LastMonth = Convert.ToDateTime(string.Format("{0}-{1}-{2}", DateTime.Today.ToString("yyyy"), DateTime.Today.ToString("MM"), "01")).AddMonths(-1);

    private string _dStreet;
    private string _dHouseNo;
    private string _dDataHouse;
    private string _dOccupant;
    private string _dlga;
    private string _dDescription;
    private int _dNoOfRooms;
    private string _dTotAmount;
    private int _dtAmount;
    private int _dtAMonth;
    private DateTime _dPaymentDate;
    private int _dLastPaid;
    private int _dateDiff;
    private int _toPayNow;
    private int _asDueNow;
    private int _dbTrue;
    private int _count;
    private int _asPreDue;
    private int _asSumChk;
    private int _dtGb;
    private int _dtGpb;
    private string _dInvoiceNumber, _dPaymentType;
    protected string DBillingMonth;
    protected string DBillingYear;
</script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><asp:Label ID="DStatus" runat="server" Font-Bold="True" Style="color: Green; font-size: ;" /><asp:Label ID="DError" runat="server" Style="color: Red; font-size: ;" /><p><br /></p><div align="center"><%
                        _Cnndb.Open();
                        SqlCommand getBillCmd = _Cnndb.CreateCommand();
                        getBillCmd.CommandText = string.Format("SELECT DISTINCT cb.HouseCode, cb.InvoiceNumber, cb.Street, cb.Occupant, cb.LGA, cd.HouseNo, cd.NoOfRooms, cd.Description, cb.BillingMonth, cb.BillingYear, cb.MonthlyTariff, cb.PreBalance, cb.SumBalance, cb.LastPaid, cb.PaymentType, cb.PaymentDate FROM PrintBills cb INNER JOIN CustomerData cd ON cb.HouseCode = cd.HouseCode WHERE (cb.PrintStatus IS NULL AND cb.ZoneName = '{0}' OR cb.HouseCode = '{0}' OR cb.Occupant = '{0}' OR cb.Street = '{0}') AND (cb.Domain = '{1}' OR cb.Domain = '{2}') AND cb.BillingMonth = '{3}' AND cb.BillingYear = '{4}' ORDER BY cb.Street ASC", Request.QueryString["ord"], Request.QueryString["DPSP"], Session["companyname"], Convert.ToString(Request.QueryString["arg"]), Convert.ToInt32(Request.QueryString["arg2"]));
                        SqlDataReader rdBill = getBillCmd.ExecuteReader();

                        while (rdBill.Read())
                        {
                            _dDataHouse = (string) rdBill["HouseCode"];
                            _dStreet = (string) rdBill["Street"];
                            _dHouseNo = (string) rdBill["HouseNo"];
                            _dOccupant = (string) rdBill["Occupant"];
                            DBillingMonth = (string) rdBill["BillingMonth"];
                            DBillingYear = (string) rdBill["BillingYear"];
                            _dlga = (string) rdBill["LGA"];
                            _dNoOfRooms = (int) rdBill["NoOfRooms"];
                            _dInvoiceNumber = (string) rdBill["InvoiceNumber"];
                            _dPaymentType = (string) rdBill["PaymentType"];
                            _dtAmount = (int) rdBill["MonthlyTariff"];
                            _asPreDue = (int) rdBill["PreBalance"];
                            _asDueNow = (int) rdBill["SumBalance"];
                            _dLastPaid = (int) rdBill["LastPaid"];
                            _dPaymentDate = (DateTime) rdBill["PaymentDate"];

                            _dTotAmount = string.Format("{0:C}", _dtAmount.ToString("C", CultureInfo.CurrentCulture).Replace("$", ""));
                            _dDescription = rdBill["Description"] != DBNull.Value ? (string) rdBill["Description"] : "";

                            string strAmountWords = Convert.ToString(_asDueNow).Replace("-", "");
                            _count = _count + 1;
                            _toPayNow = _asDueNow;
                    %><table align="center" border="1"><tr><td><table width="880" height="100" border="0" cellpadding="0" cellspacing="0"><tr><td width="345" height="159" align="left" valign="top"><table width="345" height="150" border="0" cellpadding="0" cellspacing="0"><tr><td height="21" valign="bottom" class="font3" style="font-size: 18px; font-weight: bolder; text-transform: capitalize">Your Bill</td></tr><tr><td height="108"><table width="322" height="85" border="0" cellpadding="0" cellspacing="0"><tr><td width="71" align="left" class="font1">NAME:</td><td width="251"><small><%= _dOccupant %></small>&nbsp;</td></tr><tr><td align="left" class="font1">ADDRESS:</td><td><small><%= _dHouseNo %>&nbsp;&nbsp;&nbsp;<%= _dStreet %></small>&nbsp;</td></tr><tr><td align="left" class="font1">L.G.A.</td><td><small><%= _dlga %></small>&nbsp;</td></tr></table></td></tr></table></td><td width="535" align="right" valign="middle"><form id="form2" name="form1" method="post" action=""><table width="400" border="0" align="right" cellpadding="0" cellspacing="0"><tr><td height="30" valign="bottom"><center><b style="font-size: 20px; font-weight: bolder; text-transform: capitalize"><%--<%=_cDomain %>--%><%= Request.QueryString["DPSP"] %></b></center></td></tr><tr><td height="32" valign="bottom"><table width="402" border="0" cellspacing="0" cellpadding="0"><tr><td width="18" align="left"><img src="../images/icons/bullet.png" width="14" height="14" /></td><td width="147" class="font1"><b style="font-size: 12px">Customer Care:</b></td><td width="259"><small><b></b></small></td></tr><tr><td width="18" align="left"><img src="../images/icons/bullet.png" width="14" height="14" /></td><td width="147" class="font1"><b style="font-size: 12px">Email:</b></td><td width="259"><small><b></b></small></td></tr><tr><td width="18" align="left"><img src="../images/icons/bullet.png" width="14" height="14" /></td><td width="147" class="font1" nowrap="nowrap"><b class="font4" style="color: #000">Account Number:</b></td><td width="259"><b><%--<%= _accountNumber %>--%><%= Request.QueryString["account"] %></b></td></tr><tr><td align="left"><img src="../images/icons/bullet.png" width="14" height="14" /></td><td class="font1"><b style="font-size: 12px">Invoice No:</b></td><td><small><b><%= _dInvoiceNumber %></b></small>&nbsp;</td></tr><tr><td width="19" align="left"><img src="../images/icons/bullet.png" width="14" height="14" /></td><td width="156" nowrap="nowrap"><b style="font-size: 12px">Bill Reference HouseCode:</b></td><td width="227" nowrap="nowrap"><small><b><%= Session["HouseCode"] %></b></small></td></tr><tr><td align="left"><img src="../images/icons/bullet.png" width="14" height="14" /></td><td class="font1"><b style="font-size: 12px">Invoice/Date:</b></td><td><small><b><%= DateTime.Today.ToString("yyyy-MM-dd") %></b></small>&nbsp;</td></tr></table></td></tr><tr><td height="65" valign="middle" style="font-size: 18px; font-weight: bolder; text-transform: capitalize">Let us make&nbsp;</td></tr></table></form></td></tr></table></td></tr><tr><td valign="top"><table width="878" border="1" cellspacing="0" cellpadding="0"><tr><th width="270" height="24" align="center"><div align="center">
                                                    Description of property</div></th><th width="200" align="center" nowrap="nowrap"><div align="center">
                                                    Unit price</div></th><th width="200" align="center" nowrap="nowrap"><div align="center">
                                                    Total</div></th></tr><tr><td height="19" align="center"><small>Previous Balance</small></td><td class="border_l">&nbsp;</td><td align="center" nowrap="nowrap"><small><center><%= string.Format("{0:c}", _asPreDue).Replace("$", "₦") %></center></small></td></tr><tr><td height="19" align="center"><small><% if (_dPaymentType == "REBATED")
                                                       { %>
                                                        Rebated Amount<% }
                                                       else
                                                       { %>
                                                        Last Payment<% } %><% if (_dLastPaid != 0)
                                                       { %> -<%= string.Format("{0:D}", _dPaymentDate) %><% } %></small></td><td class="border_l">&nbsp;</td><td align="center" nowrap="nowrap"><small><center><% if (_dLastPaid != 0)
                                                           { %>
                                                            (<%= string.Format("{0:C}", _dLastPaid).Replace("$", "₦") %>)<% }
                                                           else
                                                           { %>
                                                            (-)<% } %></center><%-- <center><%if (_dLastPaid != 0)
                                                                                  {
                                                                                      if (_dPaymentDate > LastMonth)
                                                                                      { %>
                                                                                    (<%= string.Format("{0:C}", _dLastPaid.ToString().Replace("$", "")) %>)<% }else
                                                                                      {%>
                                                                                        (-)<% } %><%}
                                                                                          else
                                                                                          {%>
                                                                                    (-)<%}%></center>--%></small></td></tr><tr><td height="10" align="center" nowrap="nowrap"><small>Bill For The Month Of&nbsp;<%= DBillingMonth %>&nbsp;-&nbsp;<%= Convert.ToInt32(Request.QueryString["arg2"]) %><br /><%
                                                    %>
                                                    Monthly Charges For: &nbsp;&nbsp;&nbsp;<%= _dNoOfRooms %>&nbsp;<%= _dDescription %>&nbsp;&nbsp;<%= _dTotAmount %><br /><%
                                                    %></small></td><td class="border_l">&nbsp;</td><td align="center"><center> <small><%= string.Format("{0:C}", _dTotAmount).Replace("$", "₦") %></small></center></td></tr><%
                                        %><p>&nbsp;</p><%
                                        %><tr><td height="10" align="center" class="style1"><small>Total Due Now</small></td><td align="center" class="font4">&nbsp;</td><td align="center" class="font4" nowrap="nowrap"><center> <b><small><%= string.Format("{0:C}", _asDueNow).Replace("$", "₦").Replace("(", "-").Replace(")", "") %></small></b></center></td></tr></table></td></tr></table><br/><br/><% } %></div></div></form></body></html>

Thanks

Required field and regular expression validation on TextBox with MaskedEditExtender

$
0
0

I have a web form with some fields for Social Security Number and phone number, so I have textboxes set up with MaskedEditExtenders to enforce the proper format during entry.  I had used both a RequiredFieldValidator and RegularExpressionValidator to do this, as well as added ValidationCalloutExtenders to both validators.  The problem is that when the submit button is clicked, the fields say they values aren't in the right format -- the RegularExpressionValidator is saying this and the RequiredFieldValidator doesn't appear to be working.

I realize the mask might be causing the RequiredFieldValidator to think a value is provided, so I changed the InitialValue of match the prompt, but that didn't work.  I also tried various combinations of the MaskedEditExtender's properties, namely ClearMaskOnLostFocus and ClearTextOnInvalid.  No matter what I do this doesn't work the way I want to.

I was looking through one of my books and I found the MaskedEditValidator, thinking this might help deal with this issue, so I tried it, but still I can't get the results I'm looking for.  If the field with the mask is empty, I need to show a message saying the field is required.  If the entered data doesn't match the format, I want to display a message saying the entered data isn't in the correct format.  I've spent a whole day trying to figure this out and I'm stumped.  Below is code that does nothing but collect the SSN.  Please tell me what I need to change to get this working.  Thanks.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MaskedEditTest.Default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="act" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><act:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableViewState="false" /><div><asp:Label ID="lblSSN" runat="server" AssociatedControlID="txtSSN" EnableViewState="false" Text="SSN *:" /><asp:TextBox ID="txtSSN" runat="server" autocomplete="off" AutoCompleteType="Disabled" Columns="11" MaxLength="11" /><act:MaskedEditExtender ID="meeSSN" runat="server" EnableViewState="false" Mask="999-99-9999" MaskType="Number" TargetControlID="txtSSN" /><act:MaskedEditValidator ID="mevSSN" runat="server" 
					ControlExtender="meeSSN" 
					ControlToValidate="txtSSN" 
					Display="None"
					EmptyValueMessage="SSN is required" 
					EnableViewState="false" 
					InvalidValueMessage="SSN must be valid" 
					IsValidEmpty="false" 
					SetFocusOnError="true" 
					ValidationExpression="^\d{3}-\d{2}-\d{4}$" 
					/><act:ValidatorCalloutExtender ID="vceSSN" runat="server" EnableViewState="false" TargetControlID="mevSSN" /><br /><asp:Button ID="btnSubmit" runat="server" EnableViewState="false" OnClick="btnSubmit_Click" Text="Submit" /></div></form></body></html>


ajax tool kit does not support on visual studio 2013

$
0
0

Hi

Ajax tool kit working fine on visual studio 2010, but i updated to visual studio 2013.

but Ajax controls are not working why

AjaxControlToolkit ComboBox DropDown hiding on Scrollbar click

$
0
0

I use a AjaxControlToolkit Combobox with the following Settings:

SuggestAppend = SuggestAppend

DropDownStyle = DropDown

My DropDown height is limited, so I enabled vertical Scrolling via CSS. But if I click in the TextBox to open my DropDown and then click on the scrollbar, the DropDown immediately disappears.

This seems to be caused by the internal _onTextBoxBlur javascript event of the Combobox assembly.

Can I get rid of this behaviour without recompiling a modified assembly?

Any help would be much appreciated!

How to remove or overwrite a built in eventhandler from an Ajax Toolkit Control?

$
0
0

Hello community,

I am searching for a way to remove a specific built in eventhandler from an Ajax Control like the ComboBox.

I've created an own WebControl which adds a AjaxControlToolkit.ComboBox to it.

I then configure my control clientside with some jQuery code inside of an MyComboBox.js file for my control class (just like the controls inside the AjaxControlToolkit are created).

Let's say I want to remove the jQuery eventhandler onBlur() for the nested textBox control because I want to rewrite it on my own.

As far as I could discover it works well for whole controls built into the ComboBox.

For example:

$clearHandlers(this._myComboBox.get_textBoxControl());

works fine and removes all handlers from the textBox control built into the Ajax ComboBox.

But what if I want to remove only one single eventhandler?

I already tried:

$removeHandler(this._myComboBox.get_textBoxControl(), 'blur', this._myComboBox._textBoxBlurHandler);$removeHandler(this._myComboBox.get_textBoxControl(), 'blur', this._myComboBox._onTextBoxBlur);
this._myComboBox.get_events().removeHandler('blur', this._myComboBox._textBoxBlurHandler);

But nothing worked yet.

Has anyone done that before?

Is it possible at all?

Many thanks for your help.

Cheers

New to this! Please help if you can :)

$
0
0

Hello, 

I am currently trying to make something that is a cross between the following two websites

http://www.panzoid.com/tools/backgrounder.aspx

https://www.canva.com/

I copied the coding from panzoid and tried to edit it in dreamweaver but i think it will work as the actual coding required for a tool like this to 

work has to be server side? 

I think im way out of my league here but could someone tell me how can i edit the graphics and generally move a few things around

(In which software) I sort of assumed it had to be done in Visual Studio? If anyone could tell me a little more on how i should go about

this id be greatful!

Thanks! 

Cascading Dropdown; Getting value of ContextKey

$
0
0

I need help on how to get value in the context key.

Below is my html code

<ajaxToolkit:CascadingDropDown ID="ccd4" runat="server"
      ServicePath="~/Vehicles.asmx" ServiceMethod="GetEngines"
      TargetControlID="DropDown4" LoadingText="Loading..."  ParentControlID="DropDown3" Category="Engine" 
      PromptText="Select Engine" UseContextKey="true"  ContextKey='<%# Bind("DropDownn1") + "," + Bind("DropDown2")+ "," + Bind("DropDown3")  %>' />

 In my web method I need the split the context key string to get single value of dropdown 1, dropdown 2 and 3 but I dont know how  to get the context key string.

how to use multiple tinymce on page in asp net?

$
0
0

Hi all.

My tinymce inside user control and I use 3 tinymce in one page. My tinymce inside update panel and i use mode: 'exact' for tinymce setting. I don't want to use mode: "textareas" for tinymce. When i run my project only 1 tinymce (OtherDescTBX) load and other tinymce does not show. What is my problem and How to solve this problem?

Note:

1- My tinymce inside user control.

2- use ValidateRequest="false" for page.

3- use <httpRuntime requestValidationMode="2.0" /> in web.config.

4- use ScriptManager on masterpage.

Thank you for help.

My tinymcy code:

<script runat="server">
        public TextBox SetSize { get { return txtContent; } }

        public HiddenField getHiddenField { get { return HiddenField1; } }
</script>

<script type="text/javascript" src="editors/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
   $(function () { LoadTinyMCE(); });
   var prm = Sys.WebForms.PageRequestManager.getInstance();
   prm.add_endRequest(function (sender, e) { LoadTinyMCE(); });
   function LoadTinyMCE() {
      tinyMCE.init({
         // General options 
         mode: "exact",
         elements: "<%=txtContent.ClientID %>",
         theme: "advanced",
         plugins: "autolink,lists,pagebreak,style,layer,table,save",
 
         // Theme options
         
         // Example content CSS (should be your site CSS)
         
        // Drop lists for link/image/media/template dialogs
        
       // Style formats
       
      // Replace values for the template plugin
      template_replace_values: {
           username: "Some User",
           staffid: "991234"
       },
       setup: function (ed) { ed.onChange.add(function (ed, l) { $('[id*=HiddenField1]').val(l.content); });
    }
   });
}
</script>

<asp:TextBox runat="Server" ID="txtContent" CssClass="post" Width="100%" Height="550px" TextMode="MultiLine" />
<asp:HiddenField ID="HiddenField1" runat="server" />

My aspx page:

<%@ Register Src="UserControls/tinymce.ascx" TagPrefix="Blog" TagName="TextEditor" %>

<asp:UpdatePanel runat="server" ID="UpdatePanel2"><ContentTemplate>
<table align="center">
<tr>
<td align="right"><asp:TextBox ID="ShortDescTBX" runat="server" CssClass="ManagerTBX" Width="350px" Height="60px" TextMode="MultiLine"></asp:TextBox></td>
<td align="right"><asp:Label ID="Label3" runat="server" CssClass="ManagerLBL" Width="110px" Text="Short Desc :"></asp:Label></td>
</tr>
<tr>
<td align="right" colspan="2"><Blog:TextEditor runat="server" id="CompleteDescTBX" /></td>
<td align="right"><asp:Label ID="Label6" runat="server" CssClass="ManagerLBL" Width="110px" Text="Complete Desc :"></asp:Label></td>
</tr>
<tr>
<td align="right" colspan="2"><Blog:TextEditor runat="server" id="TechnicalDescTBX" /></td>
<td align="right"><asp:Label ID="Label9" runat="server" CssClass="ManagerLBL" Width="110px" Text="Technical Desc :"></asp:Label></td>
</tr>
<tr>
<td align="right" colspan="2"><Blog:TextEditor runat="server" id="OtherDescTBX" /></td>
<td align="right"><asp:Label ID="Label10" runat="server" CssClass="ManagerLBL" Width="110px" Text="Other Desc :"></asp:Label></td>
</tr>
</table>
</ContentTemplate></asp:UpdatePanel>

My aspx code page:

if (((ScriptManager)this.Page.Master.FindControl("ScriptManager1")).IsInAsyncPostBack)
{
        CompleteDescTBX.Text = Request.Form[CompleteDescTBX.getHiddenField.UniqueID];
        TechnicalDescTBX.Text = Request.Form[TechnicalDescTBX.getHiddenField.UniqueID];
        OtherDescTBX.Text = Request.Form[OtherDescTBX.getHiddenField.UniqueID];
}

Problem with UpdatePanel GridView refresh

$
0
0

Hi,
I have to refresh automatically a GridView. I use an UpdatePanel control and a Timer control.

This is my HTML code:

<asp:Timer ID="TMROrdiniInviati" runat="server" Interval="15000"></asp:Timer><asp:UpdatePanel ID="UPOrdiniInviati" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional" ViewStateMode="Enabled"><ContentTemplate>                                                <asp:GridView ID="GVOrdiniCorriereMG" runat="server" AutoGenerateColumns="False" BackColor="White" 
                                                        BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                                                        DataSourceID="SDSOrdiniCorriereMG" 
                                                        DataKeyNames="IDOrdine" HorizontalAlign="Center" 
                                                        EmptyDataText="Nessun ordine inviato presente in archivio" Width="95%">
							........................
							........................
							........................</asp:GridView><asp:SqlDataSource ID="SDSOrdiniCorriereMG" runat="server" ConnectionString="<%$ ConnectionStrings:AHR_PORTALE_sa_ConnectionString %>"                                 
							........................
							........................
							........................                                                        </asp:SqlDataSource></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TMROrdiniInviati" EventName="Tick" />        	</Triggers></asp:UpdatePanel>

And this is my code-behind code:

Private Sub TMROrdiniInviati_Tick1(sender As Object, e As System.EventArgs) Handles TMROrdiniInviati.Tick
     GVOrdiniCorriereMG.DataBind()
End Sub

The GridView auto-refresh works fine every 15 seconds but I have a problem when I select a GridView row by clicking on a select column.

When I click to select a GridView row, the SelectedIndexChanged event is raised when the next Timer tick event occours... so I have to wait 15 second before the selection action is executed.

I have to refresh automatically the GridView but I have, also, to work with GridView rows normally...

Thank you very much!


Ajax Controls

$
0
0
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:CalendarExtender ID="CalendarExtender1" TargetControlID="txtFittingDate" runat="server" /><asp:TextBox ID="txtFittingDate" runat="server" Width="80px"></asp:TextBox>


Hi folks, I have Ajax controls on my tool bar, I’m using visual Studio 2012, when I tried to insert the calendar picker, at runtime I am presented with the following error;

‘Calendar Extender’ is not a know element

'String was not recognized as a valid DateTime’ error in Ajax calendar

$
0
0

Hi folks, I have managed to get the Ajax calendar working ok, but now I have a new problem'String was not recognized as a valid DateTime.’

If I type the date in the textbox like so 17/11/2014 it work ok, but if I select it from the Ajax calendar I receive the following error

‘String was not recognized as a valid DateTime’

The Ajax calendar does place the same date format systle in the textbox like 17/11/2014

code below

cmd.Parameters.Add("@FittingDate", SqlDbType.Date).Value = Convert.ToDateTime(txtFittingDate.Text);

Ajax makes button visible but then throws error on that button's click

$
0
0

I have an asp (vb.net) page with a table on it for layout purposes. There are some buttons in the table. When I click on one button, it makes another row of buttons become visible. I have placed the table within a radajax panel because I would like those button clicks to just update just that table, not the rest of the page.  But when I click on one of the newly visible buttons I get a 404 javascript error.  I'm thinking that because those buttons were not visible on page load, they did not get properly hooked up with the ajaxpanel?  Does anybody know how to make this work.

Here is the HTML:

<telerik:RadAjaxPanel runat = "server"><asp:Table ID="Table1" runat="server" ><asp:TableRow ID = "rowLast"><asp:TableCell Width="200px" HorizontalAlign="Right" Font-Bold = "true" ><asp:Label ID="Label1"  runat="server" Text="Last ARS Heat:" CssClass="bhFormTitle" >  </asp:Label></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign = "Center"><asp:Label ID="lblLastHeatID"  runat="server" Text="" CssClass="bhFormTitle" >  </asp:Label></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign = "Left" columnspan = "2"><asp:Label ID="lblLastHeatStatus"  runat="server" Text="" CssClass="bhFormTitle" width = "200px">  </asp:Label></asp:TableCell></asp:TableRow><asp:TableRow ID = "rowNext" ><asp:TableCell Width="200px" HorizontalAlign="Right" Font-Bold = "true" ><asp:Label ID="Label2"  runat="server" Text="Next Planned ARS Heat:" CssClass="bhFormTitle" >  </asp:Label></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign = "Center"><asp:Label ID="lblNextHeatID"  runat="server" Text="" CssClass="bhFormTitle"  >  </asp:Label></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign = "Left" columnspan = "2"><asp:Label ID="lblNextHeatStatus"  runat="server" Text="" CssClass="bhFormTitle" width = "200px">  </asp:Label></asp:TableCell></asp:TableRow><asp:TableRow ID = "rowChangeButtons"  ><asp:TableCell Width="200px" HorizontalAlign="Right"><telerik:RadButton ID="btnChange"  text = "Change" runat="server" width = "120px" UseSubmitBehavior = "false" tooltip = "Enter a new heat as the Next Planned Heat. "> </telerik:RadButton></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign="Center"><telerik:RadButton ID="btnDelete"  text = "Delete" runat="server" width = "110px" UseSubmitBehavior = "false" tooltip = "Delete the Next Planned Heat."  > </telerik:RadButton></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign="Center"><telerik:RadButton ID="btnRequest"  text = "Request Override" runat="server"  width = "110px" UseSubmitBehavior = "false"  tooltip = "Send Email to Quality requesting override permission to run ARS." > </telerik:RadButton></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign="Center"><telerik:RadButton ID="btnOverride"  text = "Override" runat="server"  width = "110px" UseSubmitBehavior = "false" tooltip = "Enter Override code provided by Quality to approve this heat."> </telerik:RadButton></asp:TableCell></asp:TableRow><asp:TableRow ID = "rowSetupNew" Visible = "false"><asp:TableCell Width="200px" HorizontalAlign="Right" Font-Bold = "true" ><asp:Label ID="Label3"    runat="server" Text="Enter Heat ID" CssClass="bhFormTitle" >  </asp:Label></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign = "Center"><telerik:RadTextBox ID="txtNewHeatID" width = "110px" runat="server"> </telerik:RadTextBox></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign = "Center"><telerik:RadButton ID="btnValidate"  text = "Set as Next Heat" runat="server"  width = "110px" UseSubmitBehavior = "false" tooltip = "Save this Heat Number as the Next Planned Heat." > </telerik:RadButton></asp:TableCell><asp:TableCell Width="125px" HorizontalAlign = "Center"><telerik:RadButton ID="btnCancel"  text = "Cancel" runat="server"  width = "110px" UseSubmitBehavior = "false" > </telerik:RadButton></asp:TableCell></asp:TableRow><asp:TableRow ID = "rowWarning" Visible = "false"><asp:TableCell  HorizontalAlign="Center" columnspan = "4" Font-Bold = "false" ><asp:Label ID="lblWarning"    runat="server" Text="If you set a new Next Planned Heat, approval will be removed from the current planned heat."  Font-Bold = "false"  ForeColor = "Red">  </asp:Label></asp:TableCell></asp:TableRow></asp:Table></telerik:RadAjaxPanel>

In the simplest scenario when they click on btnChange, I want rowSetupNew to appear.  When they click on btnCancel within rowSetupNew, then rowSetupNew should become invisible again. Right now clicking btnChange works as expected but clicking btnCancel does not.

I tried this other ways as well including using a RadAjaxMananger and setting the ajax settings but all of them had the same problem. Any button that was not visible at the start throws a javascript error.  I also tried setting the rows visible in the html and then making them invisible in the prerender event if not ispostback but that didn't help either.

Thanks for any help.

 

Starting ModalPopup from Hyperlink Control and Keeping NavigateURL intact

$
0
0

Is it possible to start an event with the hyperlink control?


For example, when I press the control I need to start a modalpopup.

I know you may suggest to use a linkbutton but I cannot as I need to start a protocol handler (in the registry) that only starts with a direct link through the hyperlink control.

So, in my mind it should be something to this effect:

<

<asp:Hyperlink ID="HyperLink1" runat="server" navigateurl="protocol:handlerpath" click="Hyperlink1">


code behind:

Protected Sub Hyperlink1(ByVal sender as Object, byval e as system.web.ui.imageclickeventargs) handles hyperlink1.click

MyModalPopup.Show()


End Sub



Eh, but of course that doesn't work :)


Using the targetcontrol for the popup control as a hyperlink renders the hyperlink useless (as it will only open the modal popup) and not go to the navigateurl.

Any input appreciated.

Thank you!

a web form with a rich text editor

$
0
0

I am creating a web based application in C# and need to have a text area for contents and it will contain html code, it can be created in this editor or pasted from word or external program.

I have tried using the HTMLEditorExtendor from the AjaxControlToolkit, but it does not work well when I paste from word into the placeholder. If I paste it, it pastes ok, but as soon as I submit and it postbacks back, the html is no longer rendered as I pasted, its all html code. I played with the Server.HtmlDecode, but that did not help or resolve the issue.

I'm hoping somebody can assist?

Viewing all 5678 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>