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

AsyncFileUpload file size issue

$
0
0

Hi

I'm using the AsyncFileUpload control It seems to be restricted to 4MB of file size.It just freezes when uploading a larger file.

Where can I tweak it to work with larger files. I need to be able to upload up to 25MB of file size.

Thanks
Amit


'seemingly odd behavior with Update Panel and targets

$
0
0

I'm creating a web form, and I'd like the users to be able to check a radio button to indicate whether or not they are a company employee.  If the user is an employee, I'd like a textbox that I'm using to input the employee ID to become writeable and to change the background color from gray to white--vice versa for a 'No' indication.  I've felt that posting back to do this and making the user endure a page refresh is a bit much.  As such, I wanted to use an UpdatePanel.  I used to roll my own async functions with Java servlets, javascript, and html.  Then, we switched to Silverlight, for which the datalayer was inherently asynchronous.  However, I'm VERY new to .NET Ajax.

I have the following in my XAML and code behind (see below my description), and the event handlers in my code behind simply change the Color and ReadOnly attributes of the textbox.  However, when I run the code and click the radiobuttons, I end up with a second textbox on the page (with background color and read/write settings set appropriately according to the radio button checked).  As I toggle between the radio buttons, each subsequent time I click the "No" radio button,  a comma is concatenated to the Text Attribute of the textbox control, until, finally, I get a script error.  The behavior makes me think I'm generating a null pointer that eventually ends up attempting to write to a "dangerous" memory location, thus causing a crash.  I'm just not sure what's going on here or what I'm doing wrong.  Any help is much appreciated.

TIA,

MC

<table>
                    <tr>
                        <td align='left'>
                             <b>Are you a [Company Name] Employee ?</b>
                        </td>
                        <asp:UpdatePanel runat="server" ID="UpdatePanelEmpIDBox" UpdateMode="Conditional">
                            <ContentTemplate>
                                <td align="left">
                                    <asp:RadioButton runat='server' ID='rbEmployeeYes' GroupName='EmployeeRadioButtons' OnCheckedChanged="rbEmployeeYes_CheckedChanged" AutoPostBack="true" />
                                    &nbsp;&nbsp;
                                    <b>Yes</b>
                                    <asp:RadioButton runat='server' ID='rbEmployeeNo' GroupName='EmployeeRadioButtons' OnCheckedChanged="rbEmployeeNo_CheckedChanged" AutoPostBack="true" />
                                    &nbsp;&nbsp;
                                    <b>No</b>
                                    &nbsp;&nbsp;
                                </td>
                            </tr>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <asp:UpdatePanel runat="server" ID="UpdatePanelEmpIDBox2" UpdateMode="Conditional">
                            <ContentTemplate>
                                <tr>
                                    <td align='left'>
                                        <b>If yes, please enter your Employee ID #: &nbsp;&nbsp;</b>
                                    </td>
                                    <td align='left'>
                                        <asp:TextBox ID="tbEmpID" runat="server" BorderColor="Black" BorderStyle="Groove" BackColor="Gray" OnTextChanged="tbEmpID_TextChanged" AutoPostBack="true" ReadOnly="true" />
                                    </td>
                            
                                
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="rbEmployeeYes" EventName="CheckedChanged" />
                                <asp:AsyncPostBackTrigger ControlID="rbEmployeeNo" EventName="CheckedChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </tr>
                </table>

Code behind:

protected void rbEmployeeYes_CheckedChanged(object sender, EventArgs e)
        {
            if (rbEmployeeYes.Checked == true)
            {
                tbEmpID.ReadOnly = false;
                tbEmpID.BackColor = System.Drawing.Color.White;
            }
            else
            {
                tbEmpID.ReadOnly = true;
                tbEmpID.BackColor = System.Drawing.Color.Gray;
            }
        }
        protected void rbEmployeeNo_CheckedChanged(object sender, EventArgs e)
        {
            if (rbEmployeeNo.Checked == true)
            {
                tbEmpID.ReadOnly = true;
                tbEmpID.BackColor = System.Drawing.Color.Gray;
            }
            else
            {
                tbEmpID.ReadOnly = false;
                tbEmpID.BackColor = System.Drawing.Color.White;
            }
        }

Asynchronous Post Back on TextBox TextChanged

$
0
0

I have an update panel and I want to trigger asynchronous TextChanged event from TextBox. If I add event handler to TextBox, set AutoPostBack="true" and TextBox ID to Triggers in Update Panel, then nothing is happening.

 

<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged" Width="250px" AutoCompleteType="none" AutoPostBack="true"></asp:TextBox><asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="conditional" ChildrenAsTriggers="false"><Triggers><asp:AsyncPostBackTrigger ControlID="TextBox1" /></Triggers><ContentTemplate>
         ...</ContentTemplate></asp:UpdatePanel>

 

I found to way to accomplish my task with hidden button, but it doesn't look like right solution. Am I missing something?


 

 

ModalPopupExtender throws JS error 'this._onHiding.get_animation()' is null or not an object'

$
0
0

Here is how my extender is defined.

 

<ajax:ModalPopupExtender ID="myExtender" runat="server" PopupControlID="MyBigPanel" TargetControlID="btnShow"
                DropShadow="True" PopupDragHandleControlID="myPanel" BackgroundCssClass="modalBackground"
                CancelControlID="btnClose" OkControlID="imgBtnGetLoans" OnOkScript="OK();"><Animations><OnShown><FadeIn Duration=".3" Fps="20" /></OnShown><OnHiding><FadeOut Duration="0.2" Fps="10" /></OnHiding></Animations></ajax:ModalPopupExtender>

 

 

 

When I launch the browser go to my page which has this extender and navigate away or close this ; it gives me this error. I have update panel on my page and this extender is inside Update Panel. I am digging in further. If you have any information please do share...

 

Following is the AJAX Code where the exception is thrown, the line in question is highlighted... could not highlight, look for the line with comment /// <--- I cant highlight, this is the line

 

 

<script>
Sys.Extended.UI.ModalPopupBehavior.prototype = {
    initialize: function () {
        /// <summary>
        /// Initialize the behavior
        /// </summary>

        /*
        <div superpopup - drag container resizable><div -- drag handle\dropshadow foreground></div></div>
        */
        Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this, 'initialize');
        this._isIE6 = (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7);
        if (this._PopupDragHandleControlID)
            this._dragHandleElement = $get(this._PopupDragHandleControlID);

        this._popupElement = $get(this._PopupControlID);
        if (this._DropShadow) {
            this._foregroundElement = document.createElement('div');
            this._foregroundElement.id = this.get_id() + '_foregroundElement';
            this._popupElement.parentNode.appendChild(this._foregroundElement);
            this._foregroundElement.appendChild(this._popupElement);
        }
        else {
            this._foregroundElement = this._popupElement;
        }
        this._backgroundElement = document.createElement('div');
        this._backgroundElement.id = this.get_id() + '_backgroundElement';
        this._backgroundElement.style.display = 'none';
        this._backgroundElement.style.position = 'fixed';
        this._backgroundElement.style.left = '0px';
        this._backgroundElement.style.top = '0px';
        this._backgroundElement.style.zIndex = 10000;
        if (this._BackgroundCssClass) {
            this._backgroundElement.className = this._BackgroundCssClass;
        }
        this._foregroundElement.parentNode.appendChild(this._backgroundElement);

        this._foregroundElement.style.display = 'none';
        this._foregroundElement.style.position = 'fixed';
        this._foregroundElement.style.zIndex = $common.getCurrentStyle(this._backgroundElement, 'zIndex', this._backgroundElement.style.zIndex) + 1;

        this._showHandler = Function.createDelegate(this, this._onShow);
        $addHandler(this.get_element(), 'click', this._showHandler);

        if (this._OkControlID) {
            this._okHandler = Function.createDelegate(this, this._onOk);
            $addHandler($get(this._OkControlID), 'click', this._okHandler);
        }

        if (this._CancelControlID) {
            this._cancelHandler = Function.createDelegate(this, this._onCancel);
            $addHandler($get(this._CancelControlID), 'click', this._cancelHandler);
        }

        this._scrollHandler = Function.createDelegate(this, this._onLayout);
        this._resizeHandler = Function.createDelegate(this, this._onLayout);

        this.registerPartialUpdateEvents();

        this._resetAnimationsTarget();

        if (this._onHiding.get_animation()) {
            this._hidingAnimationEndedHandler = Function.createDelegate(this, function () {
                this._isAnimationJustEnded = true;
                this.hide();
            });
            this._onHiding.get_animation().add_ended(this._hidingAnimationEndedHandler);
        }

        if (this._onShowing.get_animation()) {
            this._showingAnimationEndedHandler = Function.createDelegate(this, function () {
                this._isAnimationJustEnded = true;
                this.show();
            });
            this._onShowing.get_animation().add_ended(this._showingAnimationEndedHandler);
        }
    },

    dispose: function () {
        /// <summary>
        /// Dispose the behavior
        /// </summary>

        this._hideImplementation();

        if (this._foregroundElement && this._foregroundElement.parentNode) {
            this._foregroundElement.parentNode.removeChild(this._backgroundElement);

            if (this._DropShadow) {
                this._foregroundElement.parentNode.appendChild(this._popupElement);
                this._foregroundElement.parentNode.removeChild(this._foregroundElement);
            }
        }

        this._scrollHandler = null;
        this._resizeHandler = null;
        if (this._cancelHandler && $get(this._CancelControlID)) {$removeHandler($get(this._CancelControlID), 'click', this._cancelHandler);
            this._cancelHandler = null;
        }
        if (this._okHandler && $get(this._OkControlID)) {$removeHandler($get(this._OkControlID), 'click', this._okHandler);
            this._okHandler = null;
        }
        if (this._showHandler) {$removeHandler(this.get_element(), 'click', this._showHandler);
            this._showHandler = null;
        }

        if (this._hidingAnimationEndedHandler) {
              this._onHiding.get_animation().remove_ended(this._hidingAnimationEndedHandler);  /// <--- I cant highlight, this is the line
        }

        if (this._showingAnimationEndedHandler) {
            this._onShowing.get_animation().remove_ended(this._showingAnimationEndedHandler);
        }

        Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this, 'dispose');
    },

    _attachPopup: function () {
        /// <summary>
        /// Attach the event handlers for the popup
        /// </summary>

        if (this._DropShadow && !this._dropShadowBehavior) {
            this._dropShadowBehavior = $create(Sys.Extended.UI.DropShadowBehavior, {}, null, null, this._popupElement);
        }
        if (this._dragHandleElement && !this._dragBehavior) {
            this._dragBehavior = $create(Sys.Extended.UI.FloatingBehavior, { "handle": this._dragHandleElement }, null, null, this._foregroundElement);
        }$addHandler(window, 'resize', this._resizeHandler);$addHandler(window, 'scroll', this._scrollHandler);
        this._windowHandlersAttached = true;
    },

    _detachPopup: function () {
        /// <summary>
        /// Detach the event handlers for the popup
        /// </summary>

        if (this._windowHandlersAttached) {
            if (this._scrollHandler) {
                $removeHandler(window, 'scroll', this._scrollHandler);
            }
            if (this._resizeHandler) {$removeHandler(window, 'resize', this._resizeHandler);
            }
            this._windowHandlersAttached = false;
        }

        if (this._dragBehavior) {
            this._dragBehavior.dispose();
            this._dragBehavior = null;
        }

        if (this._dropShadowBehavior) {
            this._dropShadowBehavior.dispose();
            this._dropShadowBehavior = null;
        }
    },

    _onShow: function (e) {
        /// <summary>
        /// Handler for the target's click event
        /// </summary>
        /// <param name="e" type="Sys.UI.DomEvent">
        /// Event info
        /// </param>

        if (!this.get_element().disabled) {
            this.show();
            e.preventDefault();
            return false;
        }
    },

    _onOk: function (e) {
        /// <summary>
        /// Handler for the modal dialog's OK button click
        /// </summary>
        /// <param name="e" type="Sys.UI.DomEvent">
        /// Event info
        /// </param>

        var element = $get(this._OkControlID);
        if (element && !element.disabled) {
            if (this.hide() && this._OnOkScript) {
                window.setTimeout(this._OnOkScript, 0);
            }
            e.preventDefault();
            return false;
        }
    },

    _onCancel: function (e) {
        /// <summary>
        /// Handler for the modal dialog's Cancel button click
        /// </summary>
        /// <param name="e" type="Sys.UI.DomEvent">
        /// Event info
        /// </param>

        var element = $get(this._CancelControlID);
        if (element && !element.disabled) {
            if (this.hide() && this._OnCancelScript) {
                window.setTimeout(this._OnCancelScript, 0);
            }
            e.preventDefault();
            return false;
        }
    },

    _onLayout: function (e) {
        /// <summary>
        /// Handler for scrolling and resizing events that would require a repositioning of the modal dialog
        /// </summary>
        /// <param name="e" type="Sys.UI.DomEvent">
        /// Event info
        /// </param>
        var positioning = this.get_repositionMode();
        if (((positioning === Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowScroll) ||
            (positioning === Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll)) && (e.type === 'scroll')) {
            this._layout();
        } else if (((positioning === Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResize) ||
            (positioning === Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll)) && (e.type === 'resize')) {
            this._layout();
        } else {
            this._layoutBackgroundElement();
        }
    },

    show: function () {
        /// <summary>
        /// Display the element referenced by PopupControlID as a modal dialog
        /// </summary>

        if (!this._isAnimationJustEnded) {
            var eventArgs = new Sys.CancelEventArgs();
            this.raiseShowing(eventArgs);
            if (eventArgs.get_cancel()) {
                return;
            }
            else if (this._onShowing.get_animation()) {
                this._onShowing.play();
                return;
            }
        }
        else {
            this._isAnimationJustEnded = false;
        }

        this.populate();
        this._attachPopup();

        this._backgroundElement.style.display = '';
        this._foregroundElement.style.display = '';
        this._popupElement.style.display = '';
        if (this._isIE6) {
            this._foregroundElement.style.position = 'absolute';
            this._backgroundElement.style.position = 'absolute';
            var tempRelativeOrAbsoluteParent = this._foregroundElement.parentNode;
            while (tempRelativeOrAbsoluteParent && (tempRelativeOrAbsoluteParent != document.documentElement)) {
                if ((tempRelativeOrAbsoluteParent.style.position != 'relative') && (tempRelativeOrAbsoluteParent.style.position != 'absolute')) {
                    tempRelativeOrAbsoluteParent = tempRelativeOrAbsoluteParent.parentNode;
                } else {
                    this._relativeOrAbsoluteParentElement = tempRelativeOrAbsoluteParent;
                    break;
                }
            }
        }


        this.disableTab();

        this._layout();
        this._layout();

        this.raiseShown(Sys.EventArgs.Empty);

        this._onShown.play();
    },

    disableTab: function () {
        /// <summary>
        /// Change the tab indices so we only tab through the modal popup
        /// (and hide SELECT tags in IE6)
        /// </summary>

        var i = 0;
        var tagElements;
        var tagElementsInPopUp = new Array();
        Array.clear(this._saveTabIndexes);

        for (var j = 0; j < this._tagWithTabIndex.length; j++) {
            tagElements = this._foregroundElement.getElementsByTagName(this._tagWithTabIndex[j]);
            for (var k = 0; k < tagElements.length; k++) {
                tagElementsInPopUp[i] = tagElements[k];
                i++;
            }
        }

        i = 0;
        for (var j = 0; j < this._tagWithTabIndex.length; j++) {
            tagElements = document.getElementsByTagName(this._tagWithTabIndex[j]);
            for (var k = 0; k < tagElements.length; k++) {
                if (Array.indexOf(tagElementsInPopUp, tagElements[k]) == -1) {
                    this._saveTabIndexes[i] = { tag: tagElements[k], index: tagElements[k].tabIndex };
                    tagElements[k].tabIndex = "-1";
                    i++;
                }
            }
        }

        i = 0;
        if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) {
            var tagSelectInPopUp = new Array();
            for (var j = 0; j < this._tagWithTabIndex.length; j++) {
                tagElements = this._foregroundElement.getElementsByTagName('SELECT');
                for (var k = 0; k < tagElements.length; k++) {
                    tagSelectInPopUp[i] = tagElements[k];
                    i++;
                }
            }

            i = 0;
            Array.clear(this._saveDesableSelect);
            tagElements = document.getElementsByTagName('SELECT');
            for (var k = 0; k < tagElements.length; k++) {
                if (Array.indexOf(tagSelectInPopUp, tagElements[k]) == -1) {
                    this._saveDesableSelect[i] = { tag: tagElements[k], visib: $common.getCurrentStyle(tagElements[k], 'visibility') };
                    tagElements[k].style.visibility = 'hidden';
                    i++;
                }
            }
        }
    },

    restoreTab: function () {
        /// <summary>
        /// Restore the tab indices so we tab through the page like normal
        /// (and restore SELECT tags in IE6)
        /// </summary>

        for (var i = 0; i < this._saveTabIndexes.length; i++) {
            this._saveTabIndexes[i].tag.tabIndex = this._saveTabIndexes[i].index;
        }
        Array.clear(this._saveTabIndexes);

        if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) {
            for (var k = 0; k < this._saveDesableSelect.length; k++) {
                this._saveDesableSelect[k].tag.style.visibility = this._saveDesableSelect[k].visib;
            }
            Array.clear(this._saveDesableSelect);
        }
    },

    hide: function () {
        /// <summary>
        /// Hide the modal dialog
        /// </summary>
        /// <returns type="Boolean" mayBeNull="false">
        /// Whether or not the dialog was hidden
        /// </returns>

        if (!this._isAnimationJustEnded) {
            var eventArgs = new Sys.CancelEventArgs();
            this.raiseHiding(eventArgs);
            if (eventArgs.get_cancel()) {
                return false;
            }
            else if (this._onHiding.get_animation()) {
                this._onHiding.play();
                return true;
            }
        }
        else {
            this._isAnimationJustEnded = false;
        }

        this._hideImplementation();

        this.raiseHidden(Sys.EventArgs.Empty);

        this._onHidden.play();

        return true;
    },

    _hideImplementation: function () {
        /// <summary>
        /// Internal implementation to hide the modal dialog
        /// </summary>

        this._backgroundElement.style.display = 'none';
        this._foregroundElement.style.display = 'none';

        this.restoreTab();

        this._detachPopup();
    },

    _layout: function () {
        /// <summary>
        /// Position the modal dialog 
        /// </summary>
        var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);

        var clientBounds = $common.getClientBounds();
        var clientWidth = clientBounds.width;
        var clientHeight = clientBounds.height;

        this._layoutBackgroundElement();

        var xCoord = 0;
        var yCoord = 0;
        if (this._xCoordinate < 0) {
            var foregroundelementwidth = this._foregroundElement.offsetWidth ? this._foregroundElement.offsetWidth : this._foregroundElement.scrollWidth;
            xCoord = ((clientWidth - foregroundelementwidth) / 2);
            if (this._foregroundElement.style.position == 'absolute') {
                xCoord += scrollLeft;
            }
            this._foregroundElement.style.left = xCoord + 'px';

        } else {
            if (this._isIE6) {
                this._foregroundElement.style.left = (this._xCoordinate + scrollLeft) + 'px';
                xCoord = this._xCoordinate + scrollLeft;
            }
            else {
                this._foregroundElement.style.left = this._xCoordinate + 'px';
                xCoord = this._xCoordinate;
            }
        }
        if (this._yCoordinate < 0) {
            var foregroundelementheight = this._foregroundElement.offsetHeight ? this._foregroundElement.offsetHeight : this._foregroundElement.scrollHeight;
            yCoord = ((clientHeight - foregroundelementheight) / 2);
            if (this._foregroundElement.style.position == 'absolute') {
                yCoord += scrollTop;
            }
            this._foregroundElement.style.top = yCoord + 'px';

        } else {
            if (this._isIE6) {
                this._foregroundElement.style.top = (this._yCoordinate + scrollTop) + 'px';
                yCoord = this._yCoordinate + scrollTop;
            }
            else {
                this._foregroundElement.style.top = this._yCoordinate + 'px';
                yCoord = this._yCoordinate;
            }
        }

        this._layoutForegroundElement(xCoord, yCoord);

        if (this._dropShadowBehavior) {
            this._dropShadowBehavior.setShadow();
            window.setTimeout(Function.createDelegate(this, this._fixupDropShadowBehavior), 0);
        }

        this._layoutBackgroundElement();
    },

    _layoutForegroundElement: function (xCoord, yCoord) {
        /// <summary>
        /// Set the correct location of the foreground element to ensure that it is absolutely 
        /// positioned with respect to the browser. This is just a workaround for IE 6 since
        /// elements nested in relative parents cause modal popup positioning issues and 'fixed'
        /// is not supported by IE 6. Hence we manually compute the right location of the popup.
        /// </summary>
        /// <param name="xCoord" type="Number" integer="true" maybenull="false">
        /// <param name="yCoord" type="Number" integer="true" maybenull="false">        
        /// </params>

        if (this._isIE6 && this._relativeOrAbsoluteParentElement) {
            var foregroundLocation = $common.getLocation(this._foregroundElement);
            var relativeParentLocation = $common.getLocation(this._relativeOrAbsoluteParentElement);
            var getLocationXCoord = foregroundLocation.x;
            if (getLocationXCoord != xCoord) {
                this._foregroundElement.style.left = (xCoord - relativeParentLocation.x) + 'px';
            }

            var getLocationYCoord = foregroundLocation.y;
            if (getLocationYCoord != yCoord) {
                this._foregroundElement.style.top = (yCoord - relativeParentLocation.y) + 'px';
            }
        }
    },

    _layoutBackgroundElement: function () {
        /// <summary>
        /// Set the correct location of the background element to ensure that it is absolutely 
        /// positioned with respect to the browser.
        /// </summary>

        if (this._isIE6) {
            var backgroundLocation = $common.getLocation(this._backgroundElement);
            var backgroundXCoord = backgroundLocation.x;
            if (backgroundXCoord != 0) {
                this._backgroundElement.style.left = (-backgroundXCoord) + 'px';
            }

            var backgroundYCoord = backgroundLocation.y;
            if (backgroundYCoord != 0) {
                this._backgroundElement.style.top = (-backgroundYCoord) + 'px';
            }
        }
        var clientBounds = $common.getClientBounds();
        var clientWidth = clientBounds.width;
        var clientHeight = clientBounds.height;
        this._backgroundElement.style.width = Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), clientWidth) + 'px';
        this._backgroundElement.style.height = Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), clientHeight) + 'px';
    },

    _fixupDropShadowBehavior: function () {
        /// <summary>
        /// Some browsers don't update the location values immediately, so
        /// the location of the drop shadow would always be a step behind
        /// without this method
        /// </summary>

        if (this._dropShadowBehavior) {
            this._dropShadowBehavior.setShadow();
        }
    },

    _partialUpdateEndRequest: function (sender, endRequestEventArgs) {
        /// <summary>
        /// Show the popup if requested during a partial postback
        /// </summary>
        /// <param name="sender" type="Object">
        /// Sender
        /// </param>
        /// <param name="endRequestEventArgs" type="Sys.WebForms.EndRequestEventArgs">
        /// Event arguments
        /// </param>
        /// <returns />
        Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this, '_partialUpdateEndRequest', [sender, endRequestEventArgs]);

        if (this.get_element()) {
            var action = endRequestEventArgs.get_dataItems()[this.get_element().id];
            if ("show" == action) {
                this.show();
            } else if ("hide" == action) {
                this.hide();
            }
        }

        this._layout();
    },

    _onPopulated: function (sender, eventArgs) {
        /// <summary>
        /// Re-layout the popup after we've dynamically populated
        /// </summary>
        /// <param name="sender" type="Object">
        /// Sender
        /// </param>
        /// <param name="eventArgs" type="Sys.EventArgs">
        /// Event arguments
        /// </param>
        /// <returns />
        Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this, '_onPopulated', [sender, eventArgs]);

        this._layout();
    },

    _replaceAnimationTarget: function (memberName, target) {
        var json = this[memberName].get_json();
        this[memberName] = new Sys.Extended.UI.Animation.GenericAnimationBehavior(target);
        this[memberName].set_json(json);
        this[memberName].initialize();
    },

    _resetAnimationsTarget: function () {

        var target = $get(this.get_PopupControlID());

        this._replaceAnimationTarget('_onShowing', target);
        this._replaceAnimationTarget('_onShown', target);
        this._replaceAnimationTarget('_onHiding', target);
        this._replaceAnimationTarget('_onHidden', target);
    },

    get_PopupControlID: function () {
        /// <value type="String">
        /// The ID of the element to display as a modal popup
        /// </value>
        return this._PopupControlID;
    },
    set_PopupControlID: function (value) {
        if (this._PopupControlID != value) {
            this._PopupControlID = value;
            this.raisePropertyChanged('PopupControlID');
        }
    },

    get_X: function () {
        /// <value type="Number" integer="true">
        /// The number of pixels from the left of the browser to position the modal popup.
        /// </value>
        return this._xCoordinate;
    },
    set_X: function (value) {
        if (this._xCoordinate != value) {
            this._xCoordinate = value;
            this.raisePropertyChanged('X');
        }
    },

    get_Y: function () {
        /// <value type="Number" integer="true">
        /// The number of pixels from the top of the browser to position the modal popup.
        /// </value>
        return this._yCoordinate;
    },
    set_Y: function (value) {
        if (this._yCoordinate != value) {
            this._yCoordinate = value;
            this.raisePropertyChanged('Y');
        }
    },

    get_PopupDragHandleControlID: function () {
        /// <value type="String">
        /// The ID of the element to display as the drag handle for the modal popup
        /// </value>
        return this._PopupDragHandleControlID;
    },
    set_PopupDragHandleControlID: function (value) {
        if (this._PopupDragHandleControlID != value) {
            this._PopupDragHandleControlID = value;
            this.raisePropertyChanged('PopupDragHandleControlID');
        }
    },

    get_BackgroundCssClass: function () {
        /// <value type="String">
        /// The CSS class to apply to the background when the modal popup is displayed
        /// </value>
        return this._BackgroundCssClass;
    },
    set_BackgroundCssClass: function (value) {
        if (this._BackgroundCssClass != value) {
            this._BackgroundCssClass = value;
            this.raisePropertyChanged('BackgroundCssClass');
        }
    },

    get_DropShadow: function () {
        /// <value type="Boolean">
        /// Whether or not a drop-shadow should be added to the modal popup
        /// </value>
        return this._DropShadow;
    },
    set_DropShadow: function (value) {
        if (this._DropShadow != value) {
            this._DropShadow = value;
            this.raisePropertyChanged('DropShadow');
        }
    },

    get_Drag: function () {
        /// <value type="Boolean">
        /// Obsolete: Setting the _Drag property is a noop
        /// </value>
        return this._Drag;
    },
    set_Drag: function (value) {
        if (this._Drag != value) {
            this._Drag = value;
            this.raisePropertyChanged('Drag');
        }
    },

    get_OkControlID: function () {
        /// <value type="String">
        /// The ID of the element that dismisses the modal popup
        /// </value>
        return this._OkControlID;
    },
    set_OkControlID: function (value) {
        if (this._OkControlID != value) {
            this._OkControlID = value;
            this.raisePropertyChanged('OkControlID');
        }
    },

    get_CancelControlID: function () {
        /// <value type="String">
        /// The ID of the element that cancels the modal popup
        /// </value>
        return this._CancelControlID;
    },
    set_CancelControlID: function (value) {
        if (this._CancelControlID != value) {
            this._CancelControlID = value;
            this.raisePropertyChanged('CancelControlID');
        }
    },

    get_OnOkScript: function () {
        /// <value type="String">
        /// Script to run when the modal popup is dismissed with the OkControlID
        /// </value>
        return this._OnOkScript;
    },
    set_OnOkScript: function (value) {
        if (this._OnOkScript != value) {
            this._OnOkScript = value;
            this.raisePropertyChanged('OnOkScript');
        }
    },

    get_OnCancelScript: function () {
        /// <value type="String">
        /// Script to run when the modal popup is dismissed with the CancelControlID
        /// </value>
        return this._OnCancelScript;
    },
    set_OnCancelScript: function (value) {
        if (this._OnCancelScript != value) {
            this._OnCancelScript = value;
            this.raisePropertyChanged('OnCancelScript');
        }
    },

    get_repositionMode: function () {
        /// <value type="AjaxControlToolkit.ModalPopupRepositionMode">
        /// Determines if the ModalPopup should be repositioned on window resize/scroll
        /// </value>
        return this._repositionMode;
    },
    set_repositionMode: function (value) {
        if (this._repositionMode !== value) {
            this._repositionMode = value;
            this.raisePropertyChanged('RepositionMode');
        }
    },

    get_OnShowing: function () {
        /// <value type="String" mayBeNull="true">
        /// Generic OnShowing Animation's JSON definition. Played before the Popup is being shown.
        /// </value>
        return this._onShowing.get_json();
    },

    set_OnShowing: function (value) {
        this._onShowing.set_json(value);
        this.raisePropertyChanged('OnShowing');
    },

    get_OnShown: function () {
        /// <value type="String" mayBeNull="true">
        /// Generic OnShown Animation's JSON definition. Played once the Popup is shown.
        /// </value>    
        return this._onShown.get_json();
    },

    set_OnShown: function (value) {
        this._onShown.set_json(value);
        this.raisePropertyChanged('OnShown');
    },

    get_OnHiding: function () {
        /// <value type="String" mayBeNull="true">
        /// Generic OnHiding Animation's JSON definition. Played before the Popup is being hidden.
        /// </value>
        return this._onHiding.get_json();
    },

    set_OnHiding: function (value) {
        this._onHiding.set_json(value);
        this.raisePropertyChanged('OnHiding');
    },

    get_OnHidden: function () {
        /// <value type="String" mayBeNull="true">
        /// Generic OnHidden Animation's JSON definition. Played once the Popup is hidden.
        /// </value>    
        return this._onHidden.get_json();
    },

    set_OnHidden: function (value) {
        this._onHidden.set_json(value);
        this.raisePropertyChanged('OnHidden');
    },

    add_showing: function (handler) {
        /// <summary>
        /// Add an event handler for the showing event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('showing', handler);
    },
    remove_showing: function (handler) {
        /// <summary>
        /// Remove an event handler from the showing event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('showing', handler);
    },
    raiseShowing: function (eventArgs) {
        /// <summary>
        /// Raise the showing event
        /// </summary>
        /// <param name="eventArgs" type="Sys.CancelEventArgs" mayBeNull="false">
        /// Event arguments for the showing event
        /// </param>
        /// <returns />

        var handler = this.get_events().getHandler('showing');
        if (handler) {
            handler(this, eventArgs);
        }
    },

    add_shown: function (handler) {
        /// <summary>
        /// Add an event handler for the shown event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('shown', handler);
    },
    remove_shown: function (handler) {
        /// <summary>
        /// Remove an event handler from the shown event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('shown', handler);
    },
    raiseShown: function (eventArgs) {
        /// <summary>
        /// Raise the shown event
        /// </summary>
        /// <param name="eventArgs" type="Sys.EventArgs" mayBeNull="false">
        /// Event arguments for the shown event
        /// </param>
        /// <returns />

        var handler = this.get_events().getHandler('shown');
        if (handler) {
            handler(this, eventArgs);
        }
    },

    add_hiding: function (handler) {
        /// <summary>
        /// Add an event handler for the hiding event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('hiding', handler);
    },
    remove_hiding: function (handler) {
        /// <summary>
        /// Remove an event handler from the hiding event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('hiding', handler);
    },
    raiseHiding: function (eventArgs) {
        /// <summary>
        /// Raise the hiding event
        /// </summary>
        /// <param name="eventArgs" type="Sys.CancelEventArgs" mayBeNull="false">
        /// Event arguments for the hiding event
        /// </param>
        /// <returns />

        var handler = this.get_events().getHandler('hiding');
        if (handler) {
            handler(this, eventArgs);
        }
    },

    add_hidden: function (handler) {
        /// <summary>
        /// Add an event handler for the hidden event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('hidden', handler);
    },
    remove_hidden: function (handler) {
        /// <summary>
        /// Remove an event handler from the hidden event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('hidden', handler);
    },
    raiseHidden: function (eventArgs) {
        /// <summary>
        /// Raise the hidden event
        /// </summary>
        /// <param name="eventArgs" type="Sys.EventArgs" mayBeNull="false">
        /// Event arguments for the hidden event
        /// </param>
        /// <returns />

        var handler = this.get_events().getHandler('hidden');
        if (handler) {
            handler(this, eventArgs);
        }
    }
}
</script>

 

 

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 ?

New Version & Calendar issues

$
0
0

Hi,

I have a few web apps in production, built & maintained w/ VS 2010 and using the AjaxControlToolkit v. 3.0.30512 from 5/13/2009. Recently, I  noticed that the behavior of the CalendarExtender in one app is different than the others, and incorrect.  I can see no difference in either the dll or any of the code. 

Also, I need to add some functionality to the calendar which seems should be handled perfectly by the (relatively) new StartDate property.

Rather than spend too much time trying to debug the problem and the new functionality needed, I decided to just upgrade to the latest version of the AjaxControlToolkit, 4.1.7.0123 from 1/24/2013 (according to the website).

Following the instructions on the site, I first downloaded and installed NuGet, then installed the AjaxControlToolkit.  It installed 3 dll's in the Bin folder:  AjaxControlToolkit, HtmlAgilityPack & SanitizerProviders, as well as a bunch of localized resource folders.  (There are no .js files installed that I can see.) It also put all the AjaxControlToolkit controls in the ToolBox in VS2010.  Looks good, so far.

But things do not work properly!

First of all, I am unable to drag any of the Ajax Control Toolkit or AJAX Extensions from the Toolbox onto the page.  (I can drag Standard or other controls onto the page.) 

I then hand-coded the following into the .aspx:

<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%><asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"><ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"/><asp:TextBox ID="txtDate" runat="server"
      CssClass="TxtFld"
      Width="70"
      AutoPostBack="false"/><asp:ImageButton ID="ibDate" runat="server"
      Height="18" Width="18"
      ImageUrl="~/Images/Calendar18x18.gif" ImageAlign="AbsBottom" /><asp:CalendarExtender ID="ceDate" runat="server"
      CssClass="cal_Theme1"
      StartDate="6/1/2013"
      TargetControlID="txtDate"
      FirstDayOfWeek="Monday"
      PopupPosition="TopRight"
      PopupButtonID="ibDate" /></asp:Content>

The calendar extender mostly works, except that now the PopupPosition property has no effect.  This is very important because the default position is BottomLeft, and since the control is near the bottom of the page, the calendar is mostly out of view.

Also, the StartDate does not do what I needed.   I need to be able specify the initial month shown without actually selecting a date.  For example, even though today is in March, I want the initial month shown to be June.  With the StartDate set for 6/1/2013, the initial month shown is still March, but now the Next/Previous buttons do not work until I click on the header and go to June, at which point it works more or less correctly.

So to summarize:

1.  How can I drag & drop the Ajax controls from the Toolbox?

2.  How can I display a specified  month as the starting month?

Thanks.

--Dan

 

Triggering a button click goes to page load and not to the button handler ...

$
0
0

I have the following code in my ASPx Page:

    <asp:ScriptManager ID="scrAjaxScript" runat="server"></asp:ScriptManager>

    <script language="javascript" type="text/javascript">
      function ProfileSearch_CallBack(strProfileName, strProfileId)
      {
           __doPostBack("<%=button.ClientID %>","");
      }
    </script>

   <asp:Button ID="button" runat="server" OnClick="button_Click" style="display:none;"/>

<asp:UpdatePanel runat="server" ID="upPnlEGridPanel" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="button" EventName="Click" />
            </Triggers>
       <ContentTemplate>

...

</ContentTemplate>
</Asp:UpdatePanel>

When 'ProfileSearch_CallBack' is called, it does a partial postback but instead of going to the button handler it just ends up in Page_Load. But in the headers I do see ASyncpost=true.

Where and what I am messing up here?

Modalpopup extender animation :Uncaught TypeError: Cannot call method 'remove_ended' of null

$
0
0

I am having a Listview where each row is having a button to call the modalpopup, and everything work correctly, Now, I am adding the animation to the currentl modalpopup as below :

<asp:modalpopupextender ID="ModalPopupExtender1" runat="server"
backgroundcssclass="ModalPopupBG" cancelcontrolid="btnCancel" drag="true"
popupcontrolid="popupPanel" popupdraghandlecontrolid="PopupHeader"
targetcontrolid="btnAddNew">
<Animations>
<OnShown>
<Fadein />
</OnShown>
<OnHiding>
<Fadeout />
</OnHiding>
</Animations>
</asp:modalpopupextender>

The <Animation> .... part is the newly added tag, and i notice that after adding it the modalpopup no longer function. When i check from Chrome  developer tool, it shows "Uncaught TypeError: Cannot call method 'remove_ended' of null" which is cause by a webresourse.axd file


How to control alternativing color via CSS in AccordianPane?

$
0
0

I'm using an Accordion control. For each item inside of a pane, I like to have alternating background. How do I control this background color via CSS? Below is my pane code.

<asp:AccordionPane ID="adp2000s" runat="server"><Header>
                            2000s</Header><Content><asp:SqlDataSource ID="sql2000s" runat="server"
                                ConnectionString="<%$ ConnectionStrings:ConnStr %>"
                                SelectCommand="SELECT [clsNoteID], [fstName], [lstName], [mdnName], [classOf1], [classOf2], [major1], [major2], [notes], [dateInsert] FROM [classNotes] WHERE (([approval] = @approval) AND ([archived] = @archived) AND ([cateID] = @cateID) AND ([classOf1] &gt;= @classOf1) AND ([classOf1] &lt; @classOf12)) ORDER BY [classOf1], [classOf2], [lstName]"><SelectParameters><asp:Parameter DefaultValue="True" Name="approval" Type="Boolean" /><asp:Parameter DefaultValue="False" Name="archived" Type="Boolean" /><asp:Parameter DefaultValue="1" Name="cateID" Type="Int32" /><asp:Parameter DefaultValue="2000" Name="classOf1" Type="Int32" /><asp:Parameter DefaultValue="2010" Name="classOf12" Type="Int32" /></SelectParameters></asp:SqlDataSource><asp:Accordion
                                ID="acd2000s"
                                runat="Server"
                                SelectedIndex="0"
                                HeaderCssClass="accordionHeader"
                                ContentCssClass="accordionContent"
                                AutoSize="None"
                                FadeTransitions="true"
                                TransitionDuration="250"
                                FramesPerSecond="40"
                                DataSourceID="sql2000s"><Panes></Panes><HeaderTemplate><asp:Label ID="lblFullName" runat="server" Text='<%# getName() %>' /></HeaderTemplate><ContentTemplate><asp:Label ID="lblClassNews" runat="server" Text='<%# getClassNews() %>' /></ContentTemplate></asp:Accordion></Content></asp:AccordionPane>



Use of CompletionInterval

$
0
0

What is the use of CompletionInterval  in Autocompleteextender?

Compatibility with IE10 on Win8

$
0
0

I have added a numericupdown extender to my page via the code behind file. If I run the web page in IE10 mode, the vertical spacing between the up and down buttons is much too big. If I run the page in compatibility mode, then they display better.

However, if I make any changes to a style sheet, I have to switch compatibility off and back on to reflect the changes.

BalloonPopupExtender - the property 'DisplayOnClick = false' doesn't work

$
0
0

i am using BalloonPopupExtender  to show that caps lock is on or off at keypress event only .but popup gets displayed,whenever I click in text box ,which I dont want.I set displayonclick property to false,but its not working,why??is there any other way to hide it during click event??although java script in keypress event i working fine.I am using vb.net 2010.

kindly help

thank you

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script language="javascript" type="text/javascript">
function capLock(e) {
kc = e.keyCode ? e.keyCode : e.which;
sk = e.shiftKey ? e.shiftKey : ((kc == 16) ? true : false);
var ctrl = $find('txtPassword_BalloonPopupExtender');
if (((kc >= 65 && kc <= 90) && !sk) || ((kc >= 97 && kc <= 122) && sk)) {
ctrl.showPopup();

// document.getElementById('Panel1').style.visibility = 'visible';
else {
ctrl.hidePopup();

}
//
//} document.getElementById('Panel1').style.visibility = 'hidden';

}




</script>
<title></title>
</head>

<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager3" runat="server">
</asp:ScriptManager>
<div id="divMayus" style="visibility:hidden">
<asp:Label ID="Label1" runat="server" Text="Caps Lock is On.!"></asp:Label>
</div>
<div>
<asp:Panel runat="server" ID="Panel1">
<b>caps on</b>
</asp:Panel>
<asp:TextBox ID="txtPassword" runat="server"
onmouseover="$find(this).hidePopup();" onmouseout="$find(this).hidePopup();"
onClick="$find(this).hidePopup();" TextMode="Password" onkeypress="capLock(event)">
</asp:TextBox>
<asp:BalloonPopupExtender ID="txtPassword_BalloonPopupExtender"
runat="server" CustomCssUrl="" DynamicServicePath="" Enabled="True" BalloonPopupControlID="Panel1"
ExtenderControlID="" TargetControlID="txtPassword" DisplayOnClick="false">
</asp:BalloonPopupExtender>
</div>

</form>
</body>

Extendercontrolbase.cs not found ( i re-downloaded the toolkit 4 times)

$
0
0

Not sure whats up.. im a stagiere from a new compagnie.. and i have to update their code.. and im trying with these break points to see what the code is doing.. and this error keep happening.. i cant see any code cause this blocks it everytime...  Cant find source.. and i see this:

Recherche de la source pour 'C:\Users\swalther\Projects\ACT\Releases\30512.1\AjaxControlToolkitSource\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs'. Checksum: MD5 {3f 59 80 77 8a 39 45 63 8d 65 f6 6e 24 a5 cd 69}

Le fichier 'C:\Users\swalther\Projects\ACT\Releases\30512.1\AjaxControlToolkitSource\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs' n'existe pas.
Recherche de 'C:\Users\swalther\Projects\ACT\Releases\30512.1\AjaxControlToolkitSource\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs' dans les documents de script...
Recherche de 'C:\Users\swalther\Projects\ACT\Releases\30512.1\AjaxControlToolkitSource\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs' dans les projets.
Le fichier n'a pas été trouvé dans un projet.
Recherche dans le répertoire 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'...
Recherche dans le répertoire 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Recherche dans le répertoire 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Recherche dans le répertoire 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
Recherche dans le répertoire 'c:\'...
Les paramètres de fichiers sources de débogage pour la solution active indiquent que le débogueur ne demandera pas à l'utilisateur de trouver le fichier : C:\Users\swalther\Projects\ACT\Releases\30512.1\AjaxControlToolkitSource\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs.
Le débogueur n'a pas trouvé le fichier source 'C:\Users\swalther\Projects\ACT\Releases\30512.1\AjaxControlToolkitSource\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs'.

Ive look on the web, and everyone is saying, just re-install it.. it will work fine.. well.. not here i guess.. anyone got a clue ?

How to read files from another server

$
0
0

My application is hosted in one server.
I need to read audio files from another server and i need to display all the file names in GridView.
But how can i read files from another server.My application is hosted in different server.
Please help me

got error ,while using ajax toolkit with ajax web.extensions version 1.0

$
0
0

hello all,

the reason i posted this question is that i just added ajax toolkit in my visual studio 2005 and i installed  ajax web extension version 1;

downloaded from microsoft website named "ASPAJAXExtSetup" but when i added ajax object in my web form i ve gotten this error:

"Error 1: Indirect reference is being made to assembly System.Web.Extensions version 3.5.0.0, which contains 'AjaxControlToolkit.CalendarExtender'. This Project references a prior version of System.Web.Extensions version 1.0.61025.0. To use 'AjaxControlToolkit.CalendarExtender', you must replace the reference to System.Web.Extensions with version 3.5.0.0 or higher.

 C:\inetpub\wwwroot\AJAXEnabledWebSite1\Default.aspx 1 1 C:\...\AJAXEnabledWebSite1\"


is there any option to upgrade ajax web extension version 1 to upper without installing visual studio 2008 and .net 3.5? or any other solution ?

thank you so much


ASP with AJAXCONTROLTOOLKIT

$
0
0

Hi, I am using vs2012. i installed AjaxcontrolToolkit 4.1.7.123 version. I am not able to execute programs. may be Compatibleissues. Can i have reply for this query?

Setting AutoCompleteExtender ContextKey from Ajax CascadingDropDown

$
0
0

Hi folks, Need help on setting AutoComplete ContextKey using cascaded dropdownlist.

Here is the scenario. I have two dropdownlist ( + Ajax  Cascaded DDL) & TextBox( +  AutoComplete)

DropDownList1- To Select Vehicle Type ( Air, Bus, Train)

DropDownList2-  To Select Vehicle Category (Like If Air-Economy, Bussiness Class. If Bus - A/c, Non A/c, If Train - 1Ac, 2AC, ChairCar etc)

Base on this 2 DDL selection i need to set context key of TextBox (Vehicle Name IF Air - AirIndia, Indigo, AirFrance..etc which user will be typing ) to filterout the records. 

This can be achieved by making DDL autopostback=True and Using DDL selectindexchanged events. But what i need is 

Is their a way to set AutoComplete ContextKey through CascadedDropDown selected index change. Cause i really don't need a postback to set the context key. any idea Guys......:)

Session value lost

$
0
0

Hi friend,
i am working in Asp.net 4.0,C#,IIS 7.0 and OS- windows 7 or window server 2008 R2.
My application lost session value frequently,even i am working on the page.

Following error log is generated in windows Log.

 Error Log
1. Event code:1001
    Application is starting .
2. An account was successfully logged on.

 

Subject:

                Security ID:                            SYSTEM

                Account Name:                     CARLTON4$

                Account Domain:                 WORKGROUP

                Logon ID:                               0x3e7

 

Logon Type:                                          5

 

New Logon:

                Security ID:                            SYSTEM

                Account Name:                     SYSTEM

                Account Domain:                 NT AUTHORITY

                Logon ID:                               0x3e7

                Logon GUID:                          {00000000-0000-0000-0000-000000000000}

 

Process Information:

                Process ID:                             0x284

                Process Name:                      C:\Windows\System32\services.exe

 

Network Information:

                Workstation Name:             

                Source Network Address:    -

                Source Port:                           -

 

Detailed Authentication Information:

                Logon Process:                     Advapi

                Authentication Package:     Negotiate

                Transited Services:                -

                Package Name (NTLM only):              -

                Key Length:                           0

 

This event is generated when a logon session is created. It is generated on the computer that was accessed.

 

The subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.

 

The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).

 

The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.

 

The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.

 

The authentication information fields provide detailed information about this specific logon request.

                - Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.

                - Transited services indicate which intermediate services have participated in this logon request.

                - Package name indicates which sub-protocol was used among the NTLM protocols.

                - Key length indicates the length of the generated session key. This will be 0 if no session key was requested.

Ajax CTK w/jQuery - Req Field Val shows valid when not valid clientside

$
0
0

Hi Everyone,

I current have a page with the ajax control toolkit setup & jquery on the page. As such, my jquery ready is firing twice. I have custom javascript bound to the button click which checks a checkbox on the form and then validates a specified set of groups.

Keep in mind the javascript on the page is getting called twice. In debugging my javascript, on the first execution of the javascript the validator correctly identifies the field as invalid but the second time around incorrectly says it's valid and lets the request go through to the server (which kicks back the page as not valid).

This is occuring for more than one validator and in more than one validation group butonly the second time the code is executed.

As far as I can tell, the double execution is occuring because of the toolkit as when I remove the toolkit - it no longer fires twice. I only have 1 reference to jquery placed within my toolkit script manager on my sitemap but I do pull in other javascript files on specific pages without using the script manager and this issue occurs with each button click when invalid fields are present.

If I removed the jquery reference from the script manager and include it through normal scripts tags - the issue still occurs but not on every click.

Javascript: 

$(document).ready(function ()
{
        $('#btnRegister').click(function ()
        {
            var bIsValid = true;
            var bVal = true;
            // Validate Core Items
            bVal = CheckValidationGroup("CoreValGroup");
            // If a negative result is returned, preserve it.
            if (bVal == false)
            {
                bIsValid = false;
            }

            // Validate Address Form
            // Core components
            bVal = CheckValidationGroup("AddrValGroup");
            // If a negative result is returned, preserve it.
            if (bVal == false)
            {
                bIsValid = false;
            }
            if ($("#chkBox").is(':checked'))
            {
                bVal = CheckValidationGroup("OtherValGroup");
                // If a negative result is returned, preserve it.
                if (bVal == false)
                {
                    bIsValid = false;
                }
            }
            else
            {
                // Now Validate
                bVal = CheckValidationGroup("LocalValGroup");
                // If a negative result is returned, preserve it.
                if (bVal == false)
                {
                    bIsValid = false;
                }
            }

            return bIsValid;
        });
});

function CheckValidationGroup(valGroup)
{
    var bIsValid = true;
    for (i = 0; i < Page_Validators.length; i++)
    {
        var val = Page_Validators[i];
        if (val.validationGroup == valGroup)
        {
            ValidatorValidate(Page_Validators[i], valGroup, null);
            if (Page_Validators[i].isvalid == false)
            {
                bIsValid = false;
            }
        }

    }
    return bIsValid;
}

HTML Snippet: (not full page, but one validator that is returning IsValid = true when it's not valid.)

<span class="spnReqAsterisk">*</span><span class="spnRequired">Security Word #5</span><span><asp:RequiredFieldValidator ID="valSecAnswer5" runat="server" Display="Dynamic" ValidationGroup="CoreValGroup" ControlToValidate="txtSecAnswer5"
Text="REQUIRED" ErrorMessage="Security Answer #5 is required!" CssClass="validator" /></span><asp:TextBox ID="txtSecAnswer5" runat="server" MaxLength="50"></asp:TextBox><asp:Button runat="server" Text="Register" ID="btnRegister" ClientIDMode="Static" CausesValidation="true" class="btnRegister" OnClick="btnRegister_Click" />

I hope I've provided enough material as I've been searching for a few days now and haven't found a correct solution - either stop jquery from firing twice or identify why the second firing returns a valid result.

Thank you,

Chad

ASP.NET MVC AJAX WebGrid Being Duplicated When Filtering

$
0
0

I'm working on paging, sorting, and filtering a WebGrid for the first time and I've run into a roadblock.  I have everything working but when I enter text into my search box to filter the WebGrid, I get a second WebGrid posted back to the page.  Can you help me understand why this is happening?

Here is my model:

public class ModelServices : IDisposable
    {
        private readonly Entities _entities = new Entities(HttpContext.Current.Application["connectionString"].ToString());
        public IEnumerable<Schedule> GetSchedules()
        {
            return _entities.Schedules.ToList();
        }

        public void Dispose()
        {
            _entities.Dispose();
        }
    }


Here is my controller:

public class ScheduleController : Controller
    {
        readonly ModelServices _mobjModel = new ModelServices();

        public ActionResult Index()
        {
            var schedules = _mobjModel.GetSchedules();
            return View(schedules);
        }

        [HttpPost]
        public ActionResult Index(string description)
        {
            var schedules = _mobjModel.GetSchedules();
            
            if (!string.IsNullOrEmpty(description))
                schedules = schedules.Where(s => s.Description.ToLower().Contains(description.ToLower())).ToList();

            return PartialView("_grid", schedules);
        }
    }

Here is my Index.cshtml:

@model IEnumerable<Schedule>
@using Scheduler
@using System.Globalization
@{
    ViewBag.Title = "Schedules";
    Layout = "~/Views/Shared/_Layout.cshtml";
}<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
@using (Ajax.BeginForm(new AjaxOptions 
    { HttpMethod = "Get", InsertionMode = InsertionMode.Replace, UpdateTargetId = "myGrid" }))
{<fieldset><legend>Schedules</legend><div>
            Description: <input type="text" id="description" name="description" /> <input type="submit" value="Search" /></div></fieldset>
}<div id="myGrid">
    @Html.Partial("_grid", Model)</div><div>
    Loaded at @DateTime.Now.ToString(CultureInfo.InvariantCulture)</div>

And here is my _grid.cshtml:

@model IEnumerable<Schedule>
@using Scheduler

@{
    var grid = new WebGrid(Model, rowsPerPage: 5, ajaxUpdateContainerId: "grid");
    
    @grid.GetHtml(htmlAttributes: new { id = "grid" },
                  fillEmptyRows: false,
                  alternatingRowStyle: "alternate-row",
                  headerStyle: "grid-header",
                  footerStyle: "grid-footer",
                  mode: WebGridPagerModes.All,
                  firstText: "<< First",
                  previousText: "< Prev",
                  nextText: "Next >",
                  lastText: "Last >>",
        columns: new[] {
        grid.Column("Description", style: "description"),
        grid.Column("ScheduleType", "Type", style: "scheduletype"),
        grid.Column("EnableDate", "Enable Date", s=>s.EnableDate.ToShortDateString(), style: "enabledate"),
        grid.Column("DisableDate", "Disable Date", s=>s.DisableDate != null ? s.DisableDate.ToShortDateString() : "", style: "disabledate"),
        grid.Column("", "", 
                @<text>
                    @(Html.ActionLink("Edit", "Edit", new { id = item.ScheduleId }, new { @class = "actionlink" }))
                    |
                    @(Html.ActionLink("Delete", "Delete", new { id = item.ScheduleId }, new { @class = "actionlink" }))</text>)
        })
}





Viewing all 5678 articles
Browse latest View live


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