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

Popup window if an event occurs

$
0
0

Hi,

I am trying to make a popup window to appear in my web form when a certain value in the text box accompanied to the marker exceeds a threshold.

I tried this code, but it is activated on button click, not on an event:

<head runat="server"><title></title><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script><link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
    rel="stylesheet" type="text/css" /><script type="text/javascript">$("[id*=btnPopup]").live("click", function () {$("#dialog").dialog({
           // title: "jQuery Dialog Popup",
            buttons: {
                Close: function () {$(this).dialog('close');
                }
            }
        });
        return false;
    });</script></head><body><form id="form1" runat="server"><%-- <div>--%><div id="dialog" style="display: none">
    This is a simple popup</div><%--</div>--%><asp:Button ID="btnPopup" runat="server" Text="Show Popup" /></form></body>

Can anybody help me how to activate the popup on an event that I described please?

Thanks


Ajax control tabcontainer

$
0
0

 i use  ajax control tabcontainer that are not working on internet  explorer 8 and other browser working fine please solve problem 

How to add a custom text in popup

$
0
0

Hi,

I made popup window to appear when certain threshold is exceeded. But, I want in the window the value which is examining to be displayed, and I don't know how to insert that parameter inside the window. here is the code for the popup

 if(parseInt(mark[1].substring(0,2))>80)
                        {$("#dialog").dialog({
                                    buttons: {
                                        Close: function () {$(this).dialog('close');
                                        }
                                    }
                                });
                        }

I want mark[1] to appear in the window as text. I have this for the div

<div id="dialog" style="display: none">

Can anybody help me please how to insert the specific value (mark[1]) in the window?
Thanks

ajax auto-complete return values

$
0
0

Hi, 

I am using following code return two values while using ajax autocomplete  but I  want to return 4 values please help me my code as follows.

----default.aspx

function ClientItemSelected(sender, e) {
$get("<%=hfCustomerId.ClientID %>").value = e.get_value();
}
</script>

<System.Web.Script.Services.ScriptMethod(), _
System.Web.Services.WebMethod()> _
Public Shared Function SearchCustomers(ByVal prefixText As String, ByVal count As Integer) As List(Of String)
Dim conn As SqlConnection = New SqlConnection
conn.ConnectionString = ConfigurationManager.ConnectionStrings("SQLConnection").ConnectionString
Dim cmd As SqlCommand = New SqlCommand
cmd.CommandText = "select CustomerId, ContactName from Customers where" & _
" ContactName like @SearchText + '%'"
cmd.Parameters.AddWithValue("@SearchText", prefixText)
cmd.Connection = conn
conn.Open()
Dim customers As List(Of String) = New List(Of String)
Dim sdr As SqlDataReader = cmd.ExecuteReader
While sdr.Read
Dim item As String = AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(sdr("ContactName").ToString, sdr("CustomerId").ToString)
customers.Add(item)
End While
conn.Close()
Return customers
End Function

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
 
TextBox1.Text = Request.Form(hfCustomerId.UniqueID)
TextBox2.Text = Request.Form(txtCustomer.UniqueID)
End Sub

set focus to end of text box in update panel postback not working in FF & Chrome

$
0
0

My solution is working fine in IE but not in FF & Chrome browsers. Please give suggestions/solution  to implement the functionality that works for all browsers. I am using the text box to search a grid view on keyup.

Javascript Code:

<script type="text/javascript">

        var tbPostBackTimeout = null;

        function onTextBoxChanging(sender) {
            clearTimeout(tbPostBackTimeout);

            tbPostBackTimeout = setTimeout(function () {
                __doPostBack(sender.name, '');
            }, 500);
        }

        function setFocustxt() {
            var currentCaret;
            function getCaret(textbox) {
                var textbox = $get("<%=txtSearch.ClientID%>");
                var control = document.activeElement;
                textbox.focus();
                var rang = document.selection.createRange();
                rang.setEndPoint("StartToStart", textbox.createTextRange());
                return rang.text.length;
            }


            function setfocus() {
                var txb = $get("<%=txtSearch.ClientID%>");
                var t = txb.createTextRange();
                t.collapse(true);

                t.moveStart("character", currentCaret);
                t.select();

            }

            Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(
            function (sender, e) {
                currentCaret = getCaret($get("<%=txtSearch.ClientID%>"));

            });
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(
            function (sender, e) {

                setfocus();
            });

        }

</script>

ASP.net code in update panel.

<asp:TextBox ID="txtSearch" runat="server" Width="171px" AutoPostBack="True" OnTextChanged="txtSearch_TextChanged"
            onkeyup="onTextBoxChanging(this);"  onfocus="setFocustxt();"  ></asp:TextBox>

 

LineChart

$
0
0

For some reason I am getting "Element LineChart is not a known element" error when I drop the control on the page. I've never used LineChart before so any help is appreciated. Thanks

Authorizing client script on a DataList

$
0
0

Hello everybody,

Please tell me if this is not the good forum, I have difficulties to authorize client script in a user component when it is displayed on a DataList.

To be more precise, I wrote a user component to display the details of a dish for a restaurant, and select a few options about it. This includes a Slider control from the Ajax Control Toolkit, to select the cooking level (would you prefer to say cooking grade ?), for dishes for which the cooking is managed that way, rather than light, medium, well cooked. There are also two imagebuttons, to increase or decrease the value of it of 10.

All that runs pretty good when the component is shown independently on the page, but as the aim is to allow the final customer to select a dish, of course I have to display that component in several copies on the page. So I inserted it in the ItemTemplate of a DataList.

Since I did that, the Slider runs once, and at the second attempt to modify its value, a messagebox is displayed like this :

Incorrect postback or callback argument.

When seeing that, I inserted this in the code page, to allow the first imagebutton :

    protected override void Render(HtmlTextWriter writer)
    {
        ClientScriptManager cs = Page.ClientScript;
        UserControls_AffichePlat ap = (UserControls_AffichePlat)DataList1.Controls[0].FindControl("AffichePlat1");
        ImageButton imb = (ImageButton)ap.FindControl("imgGauche10");
        string strId = imb.ClientID;
        string strCC = imb.OnClientClick;
        cs.RegisterForEventValidation(strId, strCC);
        base.Render(writer);
    }

strId and strCC looked as I planed, and a breakpoint allowed me to verify that this code is executed.

But, the imagebutton still launches the same messagebox instead of executing the client script I wrote.

Here is a copy of the beginning of the code page :

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" 
    AutoEventWireup="true" Trace="false" 
    CodeFile="Viandes.aspx.cs" Inherits="Viandes" 
    Title="Viandes" Culture="auto" 
    meta:resourcekey="PageResource1" UICulture="auto" 
    EnableEventValidation="true" %><%@ Register Src="UserControls/AffichePlat.ascx" TagName="AffichePlat" TagPrefix="uc1" %>

So you see that I placed EnableEventValidation at the end of the Page element.

Any idea what to do ?

Perhaps one more precision : for the moment being, the DataList displays one record. I shall do tests with several records (several dishes) once the test is OK with one.

How to create UpdatePanel Show in Form replace to click

$
0
0

Hii, Hello Guys,

I need help master,

I Try Create Update Panel andwant to makeas shown below guys.

Im Click Registration User Show Add User

And click View Data Show View Data

I need help, Thanks Master Kiss


AJAX Autocomplete textbox Validation

$
0
0

Hi Friends,

how I can restrict data entry to autocomplete textbox, so no one (users) can type, it should get value only via autocomplete valid returned data.

thank you.

Does WinCE4.2 with IE6 Support AJAX?

$
0
0

Hello, 

I am developing a web application and that will be mainly used in Windows CE hand sets which has WIN CE 4 with IE 6 and I just wanted to know whether AJAX and JQuery can be used in my web app or not.

I tried using UpdatePanel in my project, but, it seems to be not working. Any advice will greatly appreciated.

Thanks in advance.

Regards,

Karthik

AJAX Trigger Event Not Firing or Update Panel Not Working

$
0
0

Here is my code below. I'm stumped. I've tried everything I can find on the internet, I've tried everything I know to do. I can see the button is firing however it's not performing a postback on the page or in the update panel from what I can tell. The whole purpose of this is to fade the status label out which is not occurring. Any help would be greatly appreciated. I'm pulling out what little hair I have left. 

Things I've tried:

  • Putting the table and button outside the update panel
  • Removing the trigger
  • Removing the event portion of the trigger
  • Adding "ChildrenAsTriggers" both True and False
  • Tried using a different trigger
<asp:UpdatePanel ID="CategoryUpdatePanel" runat="server"><ContentTemplate><table style="margin-top: 10px; margin-bottom: 10px; width: 750px;"><tr><td style="text-align: right; width: 150px;">Category Name:</td><td><asp:TextBox ID="txtCategoryName" runat="server" Width="200px" CssClass="textboxappearance" MaxLength="45"></asp:TextBox></td><td style="text-align: center;">Status:<asp:CheckBox ID="chkCategoryStatus" runat="server" Checked="True" /></td><td><asp:Button ID="btnSaveCategory" runat="server" Text="Save Category" /></td></tr><tr><td colspan="4"><asp:Label ID="lblCategoryStatus" runat="server" Width="400px" Font-Size="Large" Text="Category Added Successfully"></asp:Label></td></tr></table></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="btnSaveCategory" EventName="Click" /></Triggers></asp:UpdatePanel><ajaxToolkit:AnimationExtender ID="CategoryUpdatePanel_AnimationExtender" runat="server" TargetControlID="CategoryUpdatePanel" Enabled="True"><Animations><OnClick><FadeOut Duration=".5" Fps="20" /></OnClick></Animations></ajaxToolkit:AnimationExtender>


CalendarExtender and javascript error

$
0
0

Hi,

Did anyone run into the following javascript error while using the CalendarExtender?

Uncaught Sys.ArgumentException: Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element

The error appears in the following javascript function (chrome browser):

$create = $type.create = function Component$create(type, properties, events, references, element) {
    /// <summary locid="M:J#Sys.Component.create">Instantiates a component of the specified type, attaches it to the specified element if it's  a Control or Behavior, sets the properties as described by the specified JSON object,  then calls initialize.</summary>
    /// <param name="type" type="Type">The type of the component to create.</param>
    /// <param name="properties" optional="true" mayBeNull="true">A JSON object that describes the properties and their values.</param>
    /// <param name="events" optional="true" mayBeNull="true">A JSON object that describes the events and their handlers.</param>
    /// <param name="references" optional="true" mayBeNull="true">A JSON object that describes the properties that are references to other components.  The contents of this object consists of name/id pairs.  If in a two-pass creation, the setting of these properties will be delayed until the second pass.</param>
    /// <param name="element" domElement="true" optional="true" mayBeNull="true">The DOM element the component must be attached to.</param>
    /// <returns type="Object">The component instance.</returns>
    var e = Function._validateParams(arguments, [
        {name: "type", type: Type},
        {name: "properties", mayBeNull: true, optional: true},
        {name: "events", mayBeNull: true, optional: true},
        {name: "references", mayBeNull: true, optional: true},
        {name: "element", mayBeNull: true, domElement: true, optional: true}
    ]);
    if (e) throw e;
    if (type.inheritsFrom(Sys.UI.Behavior) || type.inheritsFrom(Sys.UI.Control)) {
        if (!element) throw Error.argument('element', Sys.Res.createNoDom);
    }
    else if (element) throw Error.argument('element', Sys.Res.createComponentOnDom);
    var component = (element ? new type(element): new type());
    callIf(component, "beginUpdate");
    if (properties) {
        Sys.Component._setProperties(component, properties);
    }
    if (events) {
        for (var name in events) {
            if (!(component["add_" + name] instanceof Function)) throw new Error.invalidOperation(String.format(Sys.Res.undefinedEvent, name));
            if (!(events[name] instanceof Function)) throw new Error.invalidOperation(Sys.Res.eventHandlerNotFunction);
            component["add_" + name](events[name]);
        }
    }
    Sys.Component._register(component, references);
    return component;
}

I am building a dynamic form and I add the extender and the textbox control from codebehind.

Unfortunatelly I sometimes get the above javascript error. I have no idea why in some cases it appears and others it doesn't.

I would really appreciate your help with that.

Thanks

How to use a single control without importing all the controls from the Ajax Control Toolkit?

$
0
0

hi,

 i want to know whether can we able to  separate a control from ajax control toolkit, so that we don't want to import all the controls from ajax control toolkit for the use of single control.pls help.

MaskedEdit Extemder for facebook page name.

$
0
0

hi guys..  how can i make sure customer keyin proper facebook page name in my textbox?

for an instance.. facebook page name is www.facebook.com/Microsoft

how can i display www.facebook.com in my textbox automatically when is OnFocus.. 

and user only need to enter page number (Microsoft)

just wanna make sure proper facebook page name is enter and saving time for user. pls advise. TQ

Create a Soap 11 client in .Net with Custom binding

$
0
0

I am getting error calling a WCF service using a .Net client. I can call the same service using SoapUI. The error is listed below

{"The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.."}

The binding for the service is listed below

         <customBinding>
                <binding name="CustomBinding_IBroker">
                    <security defaultAlgorithmSuite="Basic128" authenticationMode="UserNameOverTransport"
                        requireDerivedKeys="true" securityHeaderLayout="Lax" includeTimestamp="true"
 messageSecurityVersion=

"WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
                        <localClientSettings detectReplays="false" />
                        <localServiceSettings detectReplays="false" />
                    </security>
                    <textMessageEncoding />
                    <httpsTransport />
                </binding>
            </customBinding>

Is it possible to indicate on this setting that the intention is to use Soap 11 messaging rather than 12. 

Thanks


The UpdateProgress stays forever even after the page loaded in Firefox version 32

$
0
0

Hi Everyone,

The UpdateProgress stays forever even after the page loaded in Firefox version 32 , but it works fine all the version of IE and chrome but in Firefox version 32 its not working..

We have the following functionality..

We have two Imagebutton namely

  • Imagebutton1
  • Imagebutton2

and one ModalPopupExtender and one panel . The panel will have grid control 

The TargetControlID property of the ModalPopupExtender controller will point to Imagebutton1 and PopupControlID property will point to the Panel.

When the user click on the Imagebutton1 the ModalPopupExtender shows the panel in the popup and we are getting the grid.

For the Imagebutton2  ..OnClick event we are calling the  this.ModalPopupExtender.Show();

When we click on the Imagebutton2 the updateprogress comes on screen and its stays forever and we are not able to do any activity on the screen..

This issue occurs only for the Firefox version 32

Please help

AJAX Calendar Partial Display

$
0
0

I am having a problem with a AJAX Calendar partially blocked by a CKEditor toolbar, please see the attached image and code.  Please see the included screenshot and code.  Even adjusting compatibility settings hasn't helped but the issue is only with IE 8 - 11.

Any suggestions or recommendations would be most appreciated.

Thank you in advance.

Code:

<ajaxToolkit:CalendarExtender id="CalendarExtender1" runat="server" TargetControlID="DateBox" PopupButtonID="Image1"></ajaxToolkit:CalendarExtender><CKEditor:CKEditorControl ID="CKEditor1" BasePath="~/ckeditor/" runat="server" Visible="false"></CKEditor:CKEditorControl>

issue with select all (ctrl + a) in a modal popup.

$
0
0

Hi,

When a modal popup is opened, I want to select(using Ctrl+ a) only the content present in the modal popup. 

Currently the content behind the modal popup is also getting selected.

I have tried the below methods:

1. using  Jquery focus() method to focus on the panel of the modal popup.

2. C# Focus() method to focus  on the panel of the modal popup.

3. CSS opacity.

The 2nd method works, but when the user clicks on anywhere on the modal popup the focus is lost and content behind the modal popup is getting selected.

Please help me on this.

Regards,

Salman

ajax accordion

$
0
0

hi,

I want to use ajax accordion. i want to import only single control for this. i don't want to import all the controls from ajax control toolkit for a single control. is there any way to do it. Pls help.

Function textbox Counter and other operations

$
0
0

Hello,

I have a question: I create a function to count the number of caracters of a textbox. To report the number of caracters you have avaliable. When I load the screen works. But when I click a button to clean the screen the function doesn't work anymore. Another case is when I use a function with dialog to open a screen that uses the same function. It does not work.

Follow the code in Java

            $('<%[textbox].ClientId%>').keypress(function () {
                contFunction()
            });

           function contFunction() {
            var maxlimit = 949;
            var label = document.getElementById('<%=[label].ClientID %>');
            var textbox = document.getElementById('<%=[textbox].ClientID %>');
             if (textbox.value.length > maxlimit)
                 textbox.value = textbox.value.substring(0, maxlimit);
             else
                 label.innerText = (maxlimit - textbox.value.length);
        }

Anybody has a idea what I did wrong?

Thanks, for the attention.

Viewing all 5678 articles
Browse latest View live


Latest Images

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