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

AsyncFileUpload getting Unresponsive Script on FireFox 22.0

$
0
0

On FireFox 21.0 it works fine.
Last night, version 22.0 was released, and now all pages with a AsyncFileUpload control gets the "Unresponsive Script" popup.
I'm trying to recompile with the new June release, but having a hard time getting the new events/properties of the control to show up in the IDE (like StoreToAzure, and UploadStart event)
I have customers complaining about the our site while using FireFox.
If I can't get this to work, I guess I'll have to rewrite the pages and use another File Upload.

If you go to the Sample Site: http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AsyncFileUpload/AsyncFileUpload.aspx using FireFox version 22.0, it gets the Unresonsive Script error, too.

Does anyone have any ideas??

-Scott


In built control for country, state and city list.

$
0
0

Is there any inbuilt control provided by Ajax Control toolkit, which gives dropdows for country and states accordingly?

If no then kindly suggest an easiest way to do so.

Problem with AJAXcontrolToolkit

$
0
0

I recently updated the toolkit to v7.0607 (if that is the newest one I do not know) And ever since then I have been finding random errors on my site related to controls from the kit. I'm afraid to uninstall it I don't know if I can downgrade?

I have fixed all but two - I haven't found anyone with the same issues. Please help!

1) Drag and Drop functionality for the toolkit is not functioning? All other controls drag and drop fine but when I pull something from the toolkit nothing happens in code behind or on the main page? (Started after the update)

 2) This control isn't working it is doing the opposite - it is suppose to validate Maximum Value of 9999.99 and Minimum of 0.00 - and for the last 3 months (since I put it together) it has worked fine but now it flags any number less than 1000? Says number is invalid?

<asp:TextBox ID="ItemPriceSingleTextBox" Width="60" runat="server" Text='<%# Bind("ItemPriceSingle") %>' ValidationGroup='<%#String.Format("{0}" + "{1}", "validate", Container.DisplayIndex)%>' /><asp:MaskedEditExtender
                        TargetControlID="ItemPriceSingleTextBox"
                        ID="MaskedEditExtender1"
                        runat="server"
                        Mask="999.99"
                        MaskType="Number"
                        InputDirection="RightToLeft"
                        AcceptNegative="Left"
                        DisplayMoney="Left"
                        ErrorTooltipEnabled="True" /><asp:MaskedEditValidator ID="MaskedEditValidator2"
                        runat="server"
                        ControlExtender="MaskedEditExtender2"
                        ControlToValidate="ItemPriceSingleTextBox"
                        IsValidEmpty="False"
                        MaximumValue="9999.99"
                        EmptyValueMessage="Number is required"
                        InvalidValueMessage="Number is invalid"
                        MaximumValueMessage="Maximum $9999.99"
                        MinimumValueMessage="Minimum $0.00"
                        MinimumValue="0.00"
                        EmptyValueBlurredText="*"
                        InvalidValueBlurredMessage="*"
                        MaximumValueBlurredMessage="*"
                        MinimumValueBlurredText="*"
                        Display="Dynamic"
                        TooltipMessage=""
                        ValidationGroup='<%#String.Format("{0}" + "{1}", "validate", Container.DisplayIndex)%>' />


 

 

MaskedEditExtender with MASK = 99%

$
0
0

Hi,

When I databind the textbox below and the value is less than 10, it shows _1% in the texbox and I wish to only see 1%.

The property  of ClearMaskOnLostFocus ="False"  Because I want to see the % sign in the textbox all the time.

<td style="border-width: thin; border-style: solid; border-color: darkblue;"><asp:TextBox Width="60px" ID="TB_Forecast_VM" runat="server" AutoPostBack="true"></asp:TextBox><asp:MaskedEditExtender ID="MaskedEditExtender5" runat="server" TargetControlID="TB_Forecast_VM"
        MaskType="Number" Mask='99%' ClearMaskOnLostFocus="False"></asp:MaskedEditExtender></td>

 

The control with ID 'UpdatePanel1' requires a ScriptManager

$
0
0

I add ScriptManager1 to page and then add update panel.

if I user br tag, error: The control with ID 'UpdatePanel1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it

when i remove br tag, it is work!

i use jquery in masterpage.

please help me.

ajax extension works in chrome and firefox but not IE

$
0
0

see code box for the extender in question. It seems really strange that a a MS product like ajax does not work with their own browser? Is there some kind of patch/override/etc like with CSS to account for browser differences

<ajax:calendarExtender ID="calExt" runat="server" TargetControlID="someDateBox" Format="MM/dd/yyyy" ></ajax:calendarExtender>



Problems setting focus on a control in an AJAX toolkit TabContainer / TabPanel as part of a master page

$
0
0

Hopefully someone can quickly help with this one, I have spent many hours on other articles and approaches and beleive it is able to be solved using the - AjaxControlToolkit.Utility.SetFocusOnLoad method, however I am having troubles correctly referencing the FindControl, below is the code

As this page is also using a Master page, I 'm not sure how to get around accessing the HTML <body> OnLoad for a client side solution, but would prefer a server side solution if there is one.

OnLoad

' try to force focus to a control which is itself, within an AJAX tab'
        If Not (IsNothing(Session("ControlIDforFocus"))) Then
            Try

                Session("Temp") = ""
                AjaxControlToolkit.Utility.SetFocusOnLoad(FindControl("ContentMain").FindControl(Session("ControlIDforFocus")))
                Session("Temp") = "AJAX SetFocusOnLoad worked"

            Catch ex As Exception
               Session("Temp") = "AJAX default focus failed"
            End Try

            ' track which path the try logic takes'
            TempDebugLabel2.Text = Session("Temp")

        End If

**  I now know the above code is wrong, see my later reply / correction explaining how I implimented FindControl

The Page markup

<asp:Content ID="ContentMain" ContentPlaceHolderID="MainContent" runat="server">
<asp:TabContainer ID="TestCentreTabContainer" runat="server" Width="100%" 
ActiveTabIndex="3">
<asp:TabPanel runat="server" ID="DoTestTabPanel">

         ... other layers of markup tags being DIVs and other Panels etc

         <asp:Panel ID="DoTestTab_StartTestPanel" runat="server">
              ..... this panels  content, which is not needing to be referenced at all</asp:Panel><asp:Panel ID="DoTestTab_TakeTestPanel" runat="server">

                    ... other layers of markup tags being DIVs etc

                    *** I need to be able to reference / setfocus to the below control during a postback ***<asp:TextBox ID="DoTestTab_QuestionAnswerEnteredTextBox" runat="server" Width='50px'></asp:TextBox><br /></asp:Panel></asp:TabPanel>
</asp:TabContainer>
</asp:Content>     

Update Panel throwing an error.

$
0
0

I want to update a panel that contains image control. I want that only this portion should be updated instead of whole page so i am using AJAX.

I am using this code in my aspx file:

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server"><Triggers><asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" /><asp:AsyncPostBackTrigger ControlID="Button3" EventName="Click" /></Triggers><ContentTemplate><asp:Panel ID="Panel1" runat="server" Height="602px" Width="1087px"><asp:Button ID="Button1" runat="server" Text="Remove" onclick="Button1_Click"
                        Width="70px" /><br /><asp:TextBox ID="TextBox1" runat="server" ReadOnly="True" Width="704px"></asp:TextBox><br /><asp:Image ID="Image1" runat="server" Height="488px" Width="992px" /><br /><br /><asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="&lt;&lt;"
                        Width="70px" Height="25px" /><asp:Button ID="Button3" runat="server" Height="25px" onclick="Button3_Click"
                        Text="&gt;&gt;" Width="70px" /></asp:Panel></ContentTemplate></asp:UpdatePanel>

My image control and textbox control are changed dynamically from c# code as:

protected void Button2_Click(object sender, EventArgs e)
    {
          Image1.ImageUrl = li[c].Substring(61);
          TextBox1.Text = li[c].Substring(67 + len + 8);
    }

    protected void Button3_Click(object sender, EventArgs e)
    {
       
          Image1.ImageUrl = li[c].Substring(61);
          TextBox1.Text = li[c].Substring(67 + len + 8);
    }

where c is some counter variable.

I am getting an error stating "JavaScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed."

How can I get rid of this error and load images correctly ?



Update Panel Javascript Call from Code Behind

$
0
0

Hello Experts,

   I have question, i am loading javascript from Code behind.

  But here,when using update panel then code behind javascript is not calling.

  How to Accomplish this,Help me with this.

Here is the following code:

----------------------------------

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"><title>Untitled Page</title></head><body><form id="form1" runat="server"><asp:ScriptManager EnablePartialRendering="true"
 ID="ScriptManager1" runat="server"></asp:ScriptManager><div><asp:UpdatePanel ID="UpdatePanel1" runat="server"
 UpdateMode="Conditional"><ContentTemplate><asp:Label ID="Label1" runat="server" /><br /><asp:Button ID="Button1" runat="server"
 Text="Update Both Panels" OnClick="Button1_Click" /><asp:Button ID="Button2" runat="server"
 Text="Update This Panel" OnClick="Button2_Click" /><asp:CheckBox ID="cbDate" runat="server"
 Text="Include Date" AutoPostBack="false"
 OnCheckedChanged="cbDate_CheckedChanged" /></ContentTemplate></asp:UpdatePanel><asp:UpdatePanel ID="UpdatePanel2" runat="server"
 UpdateMode="Conditional"><ContentTemplate><asp:Label ID="Label2" runat="server"
 ForeColor="red" /></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="Button1"
 EventName="Click" /><asp:AsyncPostBackTrigger ControlID="ddlColor"
 EventName="SelectedIndexChanged" /></Triggers></asp:UpdatePanel><asp:DropDownList ID="ddlColor" runat="server"
 AutoPostBack="true"
 OnSelectedIndexChanged="ddlColor_SelectedIndexChanged"><asp:ListItem Selected="true" Value="Red" /><asp:ListItem Value="Blue" /><asp:ListItem Value="Green" /></asp:DropDownList><asp:Button ID="btnScript" runat="server"  Text="Call JavaScript" OnClick="btnScript_Click"/></div></form></body></html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

public partial class Default6 : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnScript_Click(object sender, EventArgs e)
    {
        System.Text.StringBuilder sbScript = new System.Text.StringBuilder("");
        sbScript.Append("<script language='javascript'>");
        sbScript.Append("function Click() {");
        sbScript.Append("alert('test');");
        sbScript.Append("}");
        sbScript.Append("</script>");

        ScriptManager.RegisterStartupScript(this, GetType(), "ClientScript", "<script>" + sbScript.ToString() + "</script>", true);
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if (cbDate.Checked)
        {
            Label1.Text = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss");
            Label2.Text = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss");
        }
        else
        {
            Label1.Text = DateTime.Now.ToLongTimeString();
            Label2.Text = DateTime.Now.ToLongTimeString();
        }

       

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        if (cbDate.Checked)
        {
            Label1.Text = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss");
        }
        else
        {
            Label1.Text = DateTime.Now.ToLongTimeString();
        }
    }
    protected void cbDate_CheckedChanged(object sender, EventArgs e)
    {
        cbDate.Font.Bold = cbDate.Checked;
    }
    protected void ddlColor_SelectedIndexChanged(object sender, EventArgs e)
    {
        Color c = Color.FromName(ddlColor.SelectedValue);
        Label2.ForeColor = c;
    }
}



Using Update Panel and Listview in User Control

$
0
0

Hi All,

I have a .aspx page in which there is a user control. The user control uses an update panel and some listviews. Each listview contains a link button. I am trying to add trigger dynaimcally in usercontrol codebehind. But i am getting the followinf error

"A control with ID 'lnkbtn' could not be found for the trigger in UpdatePanel 'updpnl".

Below is the code for .ascx.cs page

LinkButton lnkbtn1 = (LinkButton)lstvwCategories.FindControl("lnkbtnCategories");
        AsyncPostBackTrigger aspTrigger = new AsyncPostBackTrigger();
        aspTrigger.ControlID = "lnkbtn1";
        aspTrigger.EventName = "click";
        updpnl.Triggers.Add(aspTrigger);

Any help would be appreciated.

Ajax AsyncFileUpload Script Error

$
0
0

Hi,

I have updated to the new AjaxControlToolkit and I have used the new AsyncFileUpload control on a page.

When I load my page  I got the following error:

"A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.

Script: http://localhost:5901/ScriptResource.axd?d=lwQTcTeSAoYmm52QKHEI0iw8LxrNWInRka24ET12-9eiUw8GbqqgGolgoZE1VycMlVBAXHpig-IGnPI5nzXbkw2&t=fffffffffb3279ba:194

It also slow loading speed of page. I also increase time max_timeout in FireFox inabout:config.

I also read this article on firefox:

http://support.mozilla.com/en-US/kb/Warning+Unresponsive+script.

But it is not giving any good solution.

Do Any Experts know what could be the issue? How we can solve this?

Thanks


Ajax Control Toolkit MaskedEdit - Optionnal char

$
0
0

Hi,

 

What do you put for an optionnal numnber? I have a textbox whick takes up to 2 digits. When I entered a number less than 10 I get an error becuase it is expecting 2 digits with the following configuration :

<asp:MaskedEditExtender runat="server"
                                TargetControlID="SegmentsTextBox"
                                Mask="99"
                                MessageValidatorTip="true"
                                OnFocusCssClass="MaskedEditFocus"
                                OnInvalidCssClass="MaskedEditError"
                                MaskType="Number"
                                InputDirection="RightToLeft"
                                AcceptNegative="None"
                                ErrorTooltipEnabled="True"/>

How to set condition on page viewing

$
0
0

Hi,

I am creating an Invoice System in ASP.Net so i created two pages one customer details and anoter details. I want to ristrict a user from viewing next page directly typing the url of page without filling the form on First Page.

Playing animation from code-behind

$
0
0

Here's my scenario, upon the completion a button click event I am trying to play an animation on a panel to alert user to the status text just updated. This is in an updatepanel, so the user can't tell if pressing add to cart is working so I thought a nifty animation to get their attention would do the trick.  

The animationextender var is always returning null no matter how I go about, whether I use the behaviorid or controlid or even control.ClientID the control is not found.  I suspect that lifecycle is playing a big role here but i'm not sure how to go about it differently. 

UPDATE: Tried condnesing code with the same outcome:

 ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "tmp""<script type='text/javascript'>$find('MessageFlasher').get_OnClickBehavior().get_animation().play();</script>"False)

Here is the jquery function that is failing,

function PlayAnimation() {
                var animationExtender = $find('MessageFlasher');  //BehaviorID of Extender
                if (animationExtender)
                {
                    animationExtender.get_OnClickBehavior().get_animation().play();
                }
            };

The PlayAnimation function is being called at the end of a button click method like this

 ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "tmp""<script type='text/javascript'>PlayAnimation();</script>"False)

Here is the TargetControl and extender;

                        <asp:Panel ID="pnl_popup" ClientIDMode="Static"  runat="server" >                            <asp:Label ID="lbl_Messagef" ViewStateMode="Disabled" Text="" runat="server"  />                        </asp:Panel>
<asp:AnimationExtender ID="AnimationExtender11" BehaviorID="MessageFlasher" runat="server" Enabled="True" TargetControlID="pnl_popup"><Animations><OnClick><Sequence><EnableAction Enabled="false" /><Color AnimationTarget="pnl_popup"
                            Duration="1"
                            StartValue="#FF0000"
                            EndValue="#666666"
                            Property="style"
                            PropertyKey="backgroundColor" /><Color AnimationTarget="pnl_popup"
                            Duration="1"
                            StartValue="#FF0000"
                            EndValue="#666666"
                            Property="style"
                            PropertyKey="backgroundColor" /><EnableAction Enabled="true" /> <fadeout duration=".8" FPS="30" /></Sequence></OnClick></Animations></asp:AnimationExtender>

Cascading dropdown not working

$
0
0

I am facing a strange issue, On one page of my application cascading dropwdown is working fine and on another page its not working. The code is same for both pages.

On one page the dropdown is disabled, all the things are working fine. I have also check this with a third party tool " Fiddler". Webservcie are called properly and its also returning the data.


Update panel conflits

$
0
0

I am using many different update panels with UpdateMode=Conditional.

Now, the problem is that when anyone update panel updates, Its effect also goes on other update panel.

How to solve it ?

I want that one update panel does not effect anything to any other update panel.

ajax control toolkit - calender extender doesn't work on server

$
0
0

i'm working on a ASP.NET WebApplication using VS2012 .NET 4.5  i'm using ajax control toolkit ... & it seems to run well on my development mahcine ..

after deployement on either my local IIS or the remote one .. all pages seems to run fine except for those which has crystalreportviewer & ajax controls on the same page !

crystal reportviewer is not working either ! so i'm stuck in there & i can't find the reason why ajax don't work on this page !

here's my HTML ...

<asp:Content ID="Content5" ContentPlaceHolderID="SheetContentsPlaceHolder" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><table style="width: 100%;"><tr><td><div style="width: 100%; align-content: center; align-items: center; align-self: center;"><fieldset style="align-content: center; align-items: center; align-self: center; vertical-align: middle;"><legend>Report Filters</legend>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                Time Period Start :&nbsp;<asp:TextBox ID="txtStartingTimePeriod" runat="server" CssClass="txtStyle" Width="100px" />&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;<asp:CalendarExtender ID="CalendarExtender1" TargetControlID="txtStartingTimePeriod" FirstDayOfWeek="Sunday" Animated="true" runat="server"></asp:CalendarExtender>
                                Time Period End :&nbsp;&nbsp;<asp:TextBox ID="txtEndingTimePeriod" runat="server" CssClass="txtStyle" Width="100px" /><asp:CalendarExtender ID="CalendarExtender2" runat="server" Animated="true" TargetControlID="txtEndingTimePeriod" FirstDayOfWeek="Sunday"></asp:CalendarExtender>&nbsp;&nbsp;&nbsp;<asp:Button ID="btnLoadReport" runat="server" Text="Load Report Data" OnClick="btnLoadReport_Click" /></fieldset></div></td></tr><tr><td><CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"
                            EnableDatabaseLogonPrompt="False" EnableParameterPrompt="False"
                            Height="50px" ReportSourceID="CrystalReportSource1" ToolPanelWidth="200px" Width="350px"
                            HasRefreshButton="True" HasDrilldownTabs="True" HasExportButton="True"
                            HasPrintButton="True" HasSearchButton="True" /><CR:CrystalReportSource ID="CrystalReportSource1" runat="server"><Report FileName="..\CRM\rpt_CRMReports\PurchaseOrdersDetailedReport.rpt"></Report></CR:CrystalReportSource></td></tr><tr><td><div id="divErrorMessages" runat="server" style="width: 100%; text-align: center;"></div></td></tr></table></ContentTemplate></asp:UpdatePanel></asp:Content>


it's working when i run it from vs2012 not on my local iis or the remote server !!

Exact time between Animations in Sequence

$
0
0

Hi,

Does anyone know what exact gap in seconds is between one animation finishing and next starting when run in sequence?

I am running two Animation Extenders with animations running in sequence.

2nd animation extender runs animations timed to coincide at certain points with ones in 1st animation extender.

Some timings are very slighty out - I have checked calculations and they are right. Only thing haven't taken to account is delay occuring between animations in sequence

Thank you.

Adding Expandable / Collapse button using ajax for dynamic view of site.

$
0
0

Hello ,

           Can anyone tell me how to add "+" Sign option to expand the form so user can fill the field he want to fill.

and he can then after filling a section use "-" Sign to close the section filled.


Please guide me.. i need it because i have a huge form that is for survey stuff.. so i need it done asap !

How can i resize Images befor upload it With AJAXFileUpload ?

$
0
0

Hi all,

i hope that any one can help me with an example to learn me how can i do it - i just want to resize images befor upload it to server i use AJAXFileUpload Not AsyncFileUpload

This is my code to save images name in database and save images to server folder

protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
        {
            string Old_file_name = e.FileName;
            string new_file_name = DateTime.Now.ToString("d.M.yyyy h-mm tt" + "__") + e.FileName;
            string db_name = string.Empty;

            var full_path = Server.MapPath((String.Format("~/Images/pt_img/{0}/{1}", Session["pt_id"], Old_file_name)));
            var full_path_exits = Server.MapPath((String.Format("~/Images/pt_img/{0}/{1}", Session["pt_id"], new_file_name)));
            if (File.Exists(full_path))
            {
                db_name = new_file_name;
                AjaxFileUpload1.SaveAs(full_path_exits);
            }
            else
            {
                db_name = Old_file_name;
                AjaxFileUpload1.SaveAs(full_path);
            }

            Myfun.FireStoredProcedure("add_pt_img", new SqlParameter("@pt_id", Session["pt_id"].ToString()),
                                       new SqlParameter("img_name", db_name));
        }
    }

so please how can i dot it ?

Viewing all 5678 articles
Browse latest View live




Latest Images