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

How to use Gridview Paging inside modal popup in asp.net??

0
0

Hi all,

Hope doing well,

sir i am using modal popup to show gridview with paging but when i clicking on second page popup is getting hide.

how to make popup stable so i can get the second page also??

here is my code below:

<asp:UpdatePanel ID="UpModal" runat="server">
    <ContentTemplate>
    <asp:Panel ID="ShowHoliday" runat="server" Width="440px" style="display:none" CssClass="modalPopup">
       
                          <%-- <div style="height: 120px; overflow:auto; width:100%; text-align:center; background-color:White" >--%>
                            <table style="width:100%; height:180px">
                             <tr>
                                <td>
                                <asp:GridView ID="GridView3" OnRowDataBound="GridView3_RowDataBound" PageSize="10" runat="server" Font-Size="Smaller" CellPadding="2" OnPageIndexChanging="GridView3_PageIndexChanging1"
                                    AllowPaging="true" ForeColor="Black" CellSpacing="1" Width="400px" AutoGenerateColumns="false" Visible="true"
                                    BackColor="White">
                                    <Columns>
                                        <asp:BoundField DataField="HolidayName" HeaderText="Holiday Name"/>
                                        <asp:BoundField DataField="HolidayDate" HeaderText="Holiday Date" DataFormatString="{0:dd-MM-yyyy}"/>
                                        <asp:BoundField HeaderText="Day" />
                                    </Columns>
                                    <HeaderStyle HorizontalAlign="Center" />
                                <RowStyle HorizontalAlign="Center" />
                                </asp:GridView>
                                    </td>
                                    <td style="vertical-align:top">
                                         <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Common/images/CrossImage.jpg"/>
                                    </td>
                                   </tr>
                                </table>
                              
                          <%--  </div>--%>
                        
    </asp:Panel>
    </ContentTemplate>
    </asp:UpdatePanel>
       <ajt:ModalPopupExtender ID="ModalPopupExtender2" BackgroundCssClass="modalBackground" PopupControlID="ShowHoliday" CancelControlID="ImageButton2"  TargetControlID="Lnkholiday" runat="server">
   </ajt:ModalPopupExtender>

and source code below:

 protected void GridView3_PageIndexChanging1(object sender, GridViewPageEventArgs e)
    {
        ModalPopupExtender2.Show();
        GridView3.PageIndex = e.NewPageIndex;
        createdash1();

    }

please help me in this

thanks


Sys.WebForms.PageRequestManagerServerErrorException: There was an error generating the XML document.

0
0

I have an error in a usercontrol with updatepanel in web page when I try to change the text in TextBox (with CalendarExtender or jQuery Datepicker).

                    <asp:TextBox
                        ID="TBP"
                        runat="server"
                        Enabled="true"
                        OnTextChanged="TBP_TextChanged"
                        AutoPostBack="true"
                        >
                    </asp:TextBox>

I switch from CalendarExtender to jQuery Datepicker but I have the same error.How can I debug this error on server?

//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjaxWebForms.js
Type.registerNamespace("Sys.WebForms");Sys.WebForms.BeginRequestEventArgs=function(b,a){Sys.WebForms.BeginRequestEventArgs.initializeBase(this);this._request=b;this._postBackElement=a};Sys.WebForms.BeginRequestEventArgs.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request}};Sys.WebForms.BeginRequestEventArgs.registerClass("Sys.WebForms.BeginRequestEventArgs",Sys.EventArgs);Sys.WebForms.EndRequestEventArgs=function(c,a,b){Sys.WebForms.EndRequestEventArgs.initializeBase(this);this._errorHandled=false;this._error=c;this._dataItems=a||{};this._response=b};Sys.WebForms.EndRequestEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_error:function(){return this._error},get_errorHandled:function(){return this._errorHandled},set_errorHandled:function(a){this._errorHandled=a},get_response:function(){return this._response}};Sys.WebForms.EndRequestEventArgs.registerClass("Sys.WebForms.EndRequestEventArgs",Sys.EventArgs);Sys.WebForms.InitializeRequestEventArgs=function(b,a){Sys.WebForms.InitializeRequestEventArgs.initializeBase(this);this._request=b;this._postBackElement=a};Sys.WebForms.InitializeRequestEventArgs.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request}};Sys.WebForms.InitializeRequestEventArgs.registerClass("Sys.WebForms.InitializeRequestEventArgs",Sys.CancelEventArgs);Sys.WebForms.PageLoadedEventArgs=function(b,a,c){Sys.WebForms.PageLoadedEventArgs.initializeBase(this);this._panelsUpdated=b;this._panelsCreated=a;this._dataItems=c||{}};Sys.WebForms.PageLoadedEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_panelsCreated:function(){return this._panelsCreated},get_panelsUpdated:function(){return this._panelsUpdated}};Sys.WebForms.PageLoadedEventArgs.registerClass("Sys.WebForms.PageLoadedEventArgs",Sys.EventArgs);Sys.WebForms.PageLoadingEventArgs=function(b,a,c){Sys.WebForms.PageLoadingEventArgs.initializeBase(this);this._panelsUpdating=b;this._panelsDeleting=a;this._dataItems=c||{}};Sys.WebForms.PageLoadingEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_panelsDeleting:function(){return this._panelsDeleting},get_panelsUpdating:function(){return this._panelsUpdating}};Sys.WebForms.PageLoadingEventArgs.registerClass("Sys.WebForms.PageLoadingEventArgs",Sys.EventArgs);Sys.WebForms.PageRequestManager=function(){this._form=null;this._activeDefaultButton=null;this._activeDefaultButtonClicked=false;this._updatePanelIDs=null;this._updatePanelClientIDs=null;this._updatePanelHasChildrenAsTriggers=null;this._asyncPostBackControlIDs=null;this._asyncPostBackControlClientIDs=null;this._postBackControlIDs=null;this._postBackControlClientIDs=null;this._scriptManagerID=null;this._pageLoadedHandler=null;this._additionalInput=null;this._onsubmit=null;this._onSubmitStatements=[];this._originalDoPostBack=null;this._originalDoPostBackWithOptions=null;this._originalFireDefaultButton=null;this._originalDoCallback=null;this._isCrossPost=false;this._postBackSettings=null;this._request=null;this._onFormSubmitHandler=null;this._onFormElementClickHandler=null;this._onWindowUnloadHandler=null;this._asyncPostBackTimeout=null;this._controlIDToFocus=null;this._scrollPosition=null;this._processingRequest=false;this._scriptDisposes={};this._transientFields=["__VIEWSTATEENCRYPTED","__VIEWSTATEFIELDCOUNT"]};Sys.WebForms.PageRequestManager.prototype={_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_isInAsyncPostBack:function(){return this._request!==null},add_beginRequest:function(a){this._get_eventHandlerList().addHandler("beginRequest",a)},remove_beginRequest:function(a){this._get_eventHandlerList().removeHandler("beginRequest",a)},add_endRequest:function(a){this._get_eventHandlerList().addHandler("endRequest",a)},remove_endRequest:function(a){this._get_eventHandlerList().removeHandler("endRequest",a)},add_initializeRequest:function(a){this._get_eventHandlerList().addHandler("initializeRequest",a)},remove_initializeRequest:function(a){this._get_eventHandlerList().removeHandler("initializeRequest",a)},add_pageLoaded:function(a){this._get_eventHandlerList().addHandler("pageLoaded",a)},remove_pageLoaded:function(a){this._get_eventHandlerList().removeHandler("pageLoaded",a)},add_pageLoading:function(a){this._get_eventHandlerList().addHandler("pageLoading",a)},remove_pageLoading:function(a){this._get_eventHandlerList().removeHandler("pageLoading",a)},abortPostBack:function(){if(!this._processingRequest&&this._request){this._request.get_executor().abort();this._request=null}},_cancelPendingCallbacks:function(){for(var a=0,e=window.__pendingCallbacks.length;a<e;a++){var c=window.__pendingCallbacks[a];if(c){if(!c.async)window.__synchronousCallBackIndex=-1;window.__pendingCallbacks[a]=null;var d="__CALLBACKFRAME"+a,b=document.getElementById(d);if(b)b.parentNode.removeChild(b)}}},_commitControls:function(a,b){if(a){this._updatePanelIDs=a.updatePanelIDs;this._updatePanelClientIDs=a.updatePanelClientIDs;this._updatePanelHasChildrenAsTriggers=a.updatePanelHasChildrenAsTriggers;this._asyncPostBackControlIDs=a.asyncPostBackControlIDs;this._asyncPostBackControlClientIDs=a.asyncPostBackControlClientIDs;this._postBackControlIDs=a.postBackControlIDs;this._postBackControlClientIDs=a.postBackControlClientIDs}if(typeof b!=="undefined"&&b!==null)this._asyncPostBackTimeout=b*1000},_createHiddenField:function(c,d){var b,a=document.getElementById(c);if(a)if(!a._isContained)a.parentNode.removeChild(a);else b=a.parentNode;if(!b){b=document.createElement("span");b.style.cssText="display:none !important";this._form.appendChild(b)}b.innerHTML="<input type='hidden' />";a=b.childNodes[0];a._isContained=true;a.id=a.name=c;a.value=d},_createPageRequestManagerTimeoutError:function(){var b="Sys.WebForms.PageRequestManagerTimeoutException: "+Sys.WebForms.Res.PRM_TimeoutError,a=Error.create(b,{name:"Sys.WebForms.PageRequestManagerTimeoutException"});a.popStackFrame();return a},_createPageRequestManagerServerError:function(a,d){var c="Sys.WebForms.PageRequestManagerServerErrorException: "+(d||String.format(Sys.WebForms.Res.PRM_ServerError,a)),b=Error.create(c,{name:"Sys.WebForms.PageRequestManagerServerErrorException",httpStatusCode:a});b.popStackFrame();return b},_createPageRequestManagerParserError:function(b){var c="Sys.WebForms.PageRequestManagerParserErrorException: "+String.format(Sys.WebForms.Res.PRM_ParserError,b),a=Error.create(c,{name:"Sys.WebForms.PageRequestManagerParserErrorException"});a.popStackFrame();return a},_createPostBackSettings:function(c,b,a){return {async:c,panelID:b,sourceElement:a}},_convertToClientIDs:function(a,d,c){if(a)for(var b=0,e=a.length;b<e;b++){Array.add(d,a[b]);Array.add(c,this._uniqueIDToClientID(a[b]))}},_destroyTree:function(f){if(f.nodeType===1){var d=f.childNodes;for(var b=d.length-1;b>=0;b--){var a=d[b];if(a.nodeType===1){if(a.dispose&&typeof a.dispose==="function")a.dispose();else if(a.control&&typeof a.control.dispose==="function")a.control.dispose();var e=Sys.UI.Behavior.getBehaviors(a);for(var c=e.length-1;c>=0;c--)e[c].dispose();this._destroyTree(a)}}}},dispose:function(){if(this._form){Sys.UI.DomEvent.removeHandler(this._form,"submit",this._onFormSubmitHandler);Sys.UI.DomEvent.removeHandler(this._form,"click",this._onFormElementClickHandler);Sys.UI.DomEvent.removeHandler(window,"unload",this._onWindowUnloadHandler);Sys.UI.DomEvent.removeHandler(window,"load",this._pageLoadedHandler)}if(this._originalDoPostBack){window.__doPostBack=this._originalDoPostBack;this._originalDoPostBack=null}if(this._originalDoPostBackWithOptions){window.WebForm_DoPostBackWithOptions=this._originalDoPostBackWithOptions;this._originalDoPostBackWithOptions=null}if(this._originalFireDefaultButton){window.WebForm_FireDefaultButton=this._originalFireDefaultButton;this._originalFireDefaultButton=null}if(this._originalDoCallback){window.WebForm_DoCallback=this._originalDoCallback;this._originalDoCallback=null}this._form=null;this._updatePanelIDs=null;this._updatePanelClientIDs=null;this._asyncPostBackControlIDs=null;this._asyncPostBackControlClientIDs=null;this._postBackControlIDs=null;this._postBackControlClientIDs=null;this._asyncPostBackTimeout=null;this._scrollPosition=null},_doCallback:function(d,b,c,f,a,e){if(!this.get_isInAsyncPostBack())this._originalDoCallback(d,b,c,f,a,e)},_doPostBack:function(a,e){this._additionalInput=null;var b=this._form;if(a===null||typeof a==="undefined"||this._isCrossPost){this._postBackSettings=this._createPostBackSettings(false,null,null);this._isCrossPost=false}else{var f=this._uniqueIDToClientID(a),d=document.getElementById(f);if(!d)if(Array.contains(this._asyncPostBackControlIDs,a))this._postBackSettings=this._createPostBackSettings(true,this._scriptManagerID+"|"+a,null);else if(Array.contains(this._postBackControlIDs,a))this._postBackSettings=this._createPostBackSettings(false,null,null);else{var c=this._findNearestElement(a);if(c)this._postBackSettings=this._getPostBackSettings(c,a);else this._postBackSettings=this._createPostBackSettings(false,null,null)}else this._postBackSettings=this._getPostBackSettings(d,a)}if(!this._postBackSettings.async){b.onsubmit=this._onsubmit;this._originalDoPostBack(a,e);b.onsubmit=null;return}b.__EVENTTARGET.value=a;b.__EVENTARGUMENT.value=e;this._onFormSubmit()},_doPostBackWithOptions:function(a){this._isCrossPost=a&&a.actionUrl;this._originalDoPostBackWithOptions(a)},_elementContains:function(b,a){while(a){if(a===b)return true;a=a.parentNode}return false},_endPostBack:function(a,d,f){if(this._request===d.get_webRequest()){this._processingRequest=false;this._additionalInput=null;this._request=null}var e=this._get_eventHandlerList().getHandler("endRequest"),b=false;if(e){var c=new Sys.WebForms.EndRequestEventArgs(a,f?f.dataItems:{},d);e(this,c);b=c.get_errorHandled()}if(a&&!b)throw a},_findNearestElement:function(a){while(a.length>0){var d=this._uniqueIDToClientID(a),c=document.getElementById(d);if(c)return c;var b=a.lastIndexOf("$");if(b===-1)return null;a=a.substring(0,b)}return null},_findText:function(b,a){var c=Math.max(0,a-20),d=Math.min(b.length,a+20);return b.substring(c,d)},_fireDefaultButton:function(a,d){if(a.keyCode===13){var c=a.srcElement||a.target;if(!c||c.tagName.toLowerCase()!=="textarea"){var b=document.getElementById(d);if(b&&typeof b.click!=="undefined"){this._activeDefaultButton=b;this._activeDefaultButtonClicked=false;try{b.click()}finally{this._activeDefaultButton=null}a.cancelBubble=true;if(typeof a.stopPropagation==="function")a.stopPropagation();return false}}}return true},_getPageLoadedEventArgs:function(j,e){var i=[],h=[],d=e?e.updatePanelData:null,c,g,b;if(!d){c=this._updatePanelIDs;g=null;b=null}else{c=d.updatePanelIDs;g=d.childUpdatePanelIDs;b=d.panelsToRefreshIDs}var a,f;if(b)for(a=0,f=b.length;a<f;a++)Array.add(i,document.getElementById(this._uniqueIDToClientID(b[a])));for(a=0,f=c.length;a<f;a++)if(j||Array.indexOf(g,c[a])!==-1)Array.add(h,document.getElementById(this._uniqueIDToClientID(c[a])));return new Sys.WebForms.PageLoadedEventArgs(i,h,e?e.dataItems:{})},_getPageLoadingEventArgs:function(h){var g=[],f=[],c=h.updatePanelData,b=c.oldUpdatePanelIDs,j=c.updatePanelIDs,i=c.childUpdatePanelIDs,e=c.panelsToRefreshIDs,a,d;for(a=0,d=e.length;a<d;a++)Array.add(g,document.getElementById(this._uniqueIDToClientID(e[a])));for(a=0,d=b.length;a<d;a++)if(Array.indexOf(e,b[a])===-1&&(Array.indexOf(j,b[a])===-1||Array.indexOf(i,b[a])>-1))Array.add(f,document.getElementById(this._uniqueIDToClientID(b[a])));return new Sys.WebForms.PageLoadingEventArgs(g,f,h.dataItems)},_getPostBackSettings:function(a,c){var d=a,b=null;while(a){if(a.id){if(!b&&Array.contains(this._asyncPostBackControlClientIDs,a.id))b=this._createPostBackSettings(true,this._scriptManagerID+"|"+c,d);else if(!b&&Array.contains(this._postBackControlClientIDs,a.id))return this._createPostBackSettings(false,null,null);else{var e=Array.indexOf(this._updatePanelClientIDs,a.id);if(e!==-1)if(this._updatePanelHasChildrenAsTriggers[e])return this._createPostBackSettings(true,this._updatePanelIDs[e]+"|"+c,d);else return this._createPostBackSettings(true,this._scriptManagerID+"|"+c,d)}if(!b&&this._matchesParentIDInList(a.id,this._asyncPostBackControlClientIDs))b=this._createPostBackSettings(true,this._scriptManagerID+"|"+c,d);else if(!b&&this._matchesParentIDInList(a.id,this._postBackControlClientIDs))return this._createPostBackSettings(false,null,null)}a=a.parentNode}if(!b)return this._createPostBackSettings(false,null,null);else return b},_getScrollPosition:function(){var a=document.documentElement;if(a&&(this._validPosition(a.scrollLeft)||this._validPosition(a.scrollTop)))return {x:a.scrollLeft,y:a.scrollTop};else{a=document.body;if(a&&(this._validPosition(a.scrollLeft)||this._validPosition(a.scrollTop)))return {x:a.scrollLeft,y:a.scrollTop};else if(this._validPosition(window.pageXOffset)||this._validPosition(window.pageYOffset))return {x:window.pageXOffset,y:window.pageYOffset};else return {x:0,y:0}}},_initializeInternal:function(a,b){if(this._prmInitialized)throw Error.invalidOperation(Sys.WebForms.Res.PRM_CannotRegisterTwice);this._prmInitialized=true;this._scriptManagerID=a;this._form=b;this._onsubmit=this._form.onsubmit;this._form.onsubmit=null;this._onFormSubmitHandler=Function.createDelegate(this,this._onFormSubmit);this._onFormElementClickHandler=Function.createDelegate(this,this._onFormElementClick);this._onWindowUnloadHandler=Function.createDelegate(this,this._onWindowUnload);Sys.UI.DomEvent.addHandler(this._form,"submit",this._onFormSubmitHandler);Sys.UI.DomEvent.addHandler(this._form,"click",this._onFormElementClickHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._onWindowUnloadHandler);this._originalDoPostBack=window.__doPostBack;if(this._originalDoPostBack)window.__doPostBack=Function.createDelegate(this,this._doPostBack);this._originalDoPostBackWithOptions=window.WebForm_DoPostBackWithOptions;if(this._originalDoPostBackWithOptions)window.WebForm_DoPostBackWithOptions=Function.createDelegate(this,this._doPostBackWithOptions);this._originalFireDefaultButton=window.WebForm_FireDefaultButton;if(this._originalFireDefaultButton)window.WebForm_FireDefaultButton=Function.createDelegate(this,this._fireDefaultButton);this._originalDoCallback=window.WebForm_DoCallback;if(this._originalDoCallback)window.WebForm_DoCallback=Function.createDelegate(this,this._doCallback);this._pageLoadedHandler=Function.createDelegate(this,this._pageLoadedInitialLoad);Sys.UI.DomEvent.addHandler(window,"load",this._pageLoadedHandler)},_matchesParentIDInList:function(c,b){for(var a=0,d=b.length;a<d;a++)if(c.startsWith(b[a]+"_"))return true;return false},_onFormElementActive:function(a,d,e){if(a.disabled)return;this._postBackSettings=this._getPostBackSettings(a,a.name);if(a.name){var b=a.tagName.toUpperCase();if(b==="INPUT"){var c=a.type;if(c==="submit")this._additionalInput=encodeURIComponent(a.name)+"="+encodeURIComponent(a.value);else if(c==="image")this._additionalInput=encodeURIComponent(a.name)+".x="+d+"&"+encodeURIComponent(a.name)+".y="+e}else if(b==="BUTTON"&&a.name.length!==0&&a.type==="submit")this._additionalInput=encodeURIComponent(a.name)+"="+encodeURIComponent(a.value)}},_onFormElementClick:function(a){this._activeDefaultButtonClicked=a.target===this._activeDefaultButton;this._onFormElementActive(a.target,a.offsetX,a.offsetY)},_onFormSubmit:function(h){var g=true,t=this._isCrossPost;this._isCrossPost=false;var e,s;if(this._onsubmit)g=this._onsubmit();if(g)for(e=0,s=this._onSubmitStatements.length;e<s;e++)if(!this._onSubmitStatements[e]()){g=false;break}if(!g){if(h)h.preventDefault();return}var n=this._form;if(t)return;if(this._activeDefaultButton&&!this._activeDefaultButtonClicked)this._onFormElementActive(this._activeDefaultButton,0,0);if(!this._postBackSettings.async)return;var a=new Sys.StringBuilder;a.append(encodeURIComponent(this._scriptManagerID)+"="+encodeURIComponent(this._postBackSettings.panelID)+"&");var v=n.elements.length;for(e=0;e<v;e++){var d=n.elements[e],f=d.name;if(typeof f==="undefined"||f===null||f.length===0||f===this._scriptManagerID)continue;var m=d.tagName.toUpperCase();if(m==="INPUT"){var k=d.type;if(k==="text"||k==="password"||k==="hidden"||(k==="checkbox"||k==="radio")&&d.checked){a.append(encodeURIComponent(f));a.append("=");a.append(encodeURIComponent(d.value));a.append("&")}}else if(m==="SELECT"){var u=d.options.length;for(var o=0;o<u;o++){var q=d.options[o];if(q.selected){a.append(encodeURIComponent(f));a.append("=");a.append(encodeURIComponent(q.value));a.append("&")}}}else if(m==="TEXTAREA"){a.append(encodeURIComponent(f));a.append("=");a.append(encodeURIComponent(d.value));a.append("&")}}a.append("__ASYNCPOST=true&");if(this._additionalInput){a.append(this._additionalInput);this._additionalInput=null}var c=new Sys.Net.WebRequest,b=n.action;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var p=b.indexOf("#");if(p!==-1)b=b.substr(0,p);var l=b.indexOf("?");if(l!==-1){var r=b.substr(0,l);if(r.indexOf("%")===-1)b=encodeURI(r)+b.substr(l)}else if(b.indexOf("%")===-1)b=encodeURI(b)}c.set_url(b);c.get_headers()["X-MicrosoftAjax"]="Delta=true";c.get_headers()["Cache-Control"]="no-cache";c.set_timeout(this._asyncPostBackTimeout);c.add_completed(Function.createDelegate(this,this._onFormSubmitCompleted));c.set_body(a.toString());var i,j=this._get_eventHandlerList().getHandler("initializeRequest");if(j){i=new Sys.WebForms.InitializeRequestEventArgs(c,this._postBackSettings.sourceElement);j(this,i);g=!i.get_cancel()}if(!g){if(h)h.preventDefault();return}this._scrollPosition=this._getScrollPosition();this.abortPostBack();j=this._get_eventHandlerList().getHandler("beginRequest");if(j){i=new Sys.WebForms.BeginRequestEventArgs(c,this._postBackSettings.sourceElement);j(this,i)}if(this._originalDoCallback)this._cancelPendingCallbacks();this._request=c;this._processingRequest=false;c.invoke();if(h)h.preventDefault()},_onFormSubmitCompleted:function(c){this._processingRequest=true;if(c.get_timedOut()){this._endPostBack(this._createPageRequestManagerTimeoutError(),c,null);return}if(c.get_aborted()){this._endPostBack(null,c,null);return}if(!this._request||c.get_webRequest()!==this._request)return;if(c.get_statusCode()!==200){this._endPostBack(this._createPageRequestManagerServerError(c.get_statusCode()),c,null);return}var a=this._parseDelta(c);if(!a)return;var b,e;if(a.asyncPostBackControlIDsNode&&a.postBackControlIDsNode&&a.updatePanelIDsNode&&a.panelsToRefreshNode&&a.childUpdatePanelIDsNode){var p=this._updatePanelIDs,h=a.childUpdatePanelIDsNode.content,n=h.length?h.split(","):[],l=this._splitNodeIntoArray(a.asyncPostBackControlIDsNode),m=this._splitNodeIntoArray(a.postBackControlIDsNode),o=this._splitNodeIntoArray(a.updatePanelIDsNode),g=this._splitNodeIntoArray(a.panelsToRefreshNode);for(b=0,e=g.length;b<e;b++){var i=this._uniqueIDToClientID(g[b]);if(!document.getElementById(i)){this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel,i)),c,a);return}}var f=this._processUpdatePanelArrays(o,l,m);f.oldUpdatePanelIDs=p;f.childUpdatePanelIDs=n;f.panelsToRefreshIDs=g;a.updatePanelData=f}a.dataItems={};var d;for(b=0,e=a.dataItemNodes.length;b<e;b++){d=a.dataItemNodes[b];a.dataItems[d.id]=d.content}for(b=0,e=a.dataItemJsonNodes.length;b<e;b++){d=a.dataItemJsonNodes[b];a.dataItems[d.id]=Sys.Serialization.JavaScriptSerializer.deserialize(d.content)}var k=this._get_eventHandlerList().getHandler("pageLoading");if(k)k(this,this._getPageLoadingEventArgs(a));Sys._ScriptLoader.readLoadedScripts();Sys.Application.beginCreateComponents();var j=Sys._ScriptLoader.getInstance();this._queueScripts(j,a.scriptBlockNodes,true,false);this._processingRequest=true;j.loadScripts(0,Function.createDelegate(this,Function.createCallback(this._scriptIncludesLoadComplete,a)),Function.createDelegate(this,Function.createCallback(this._scriptIncludesLoadFailed,a)),null)},_onWindowUnload:function(){this.dispose()},_pageLoaded:function(a,c){var b=this._get_eventHandlerList().getHandler("pageLoaded");if(b)b(this,this._getPageLoadedEventArgs(a,c));if(!a)Sys.Application.raiseLoad()},_pageLoadedInitialLoad:function(){this._pageLoaded(true,null)},_parseDelta:function(g){var c=g.get_responseData(),d,h,D,E,C,b=0,e=null,i=[];while(b<c.length){d=c.indexOf("|",b);if(d===-1){e=this._findText(c,b);break}h=parseInt(c.substring(b,d),10);if(h%1!==0){e=this._findText(c,b);break}b=d+1;d=c.indexOf("|",b);if(d===-1){e=this._findText(c,b);break}D=c.substring(b,d);b=d+1;d=c.indexOf("|",b);if(d===-1){e=this._findText(c,b);break}E=c.substring(b,d);b=d+1;if(b+h>=c.length){e=this._findText(c,c.length);break}C=c.substr(b,h);b+=h;if(c.charAt(b)!=="|"){e=this._findText(c,b);break}b++;Array.add(i,{type:D,id:E,content:C})}if(e){this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_ParserErrorDetails,e)),g,null);return null}var w=[],u=[],o=[],v=[],r=[],B=[],z=[],y=[],t=[],q=[],k,n,s,l,m,p,x;for(var j=0,F=i.length;j<F;j++){var a=i[j];switch(a.type){case "updatePanel":Array.add(w,a);break;case "hiddenField":Array.add(u,a);break;case "arrayDeclaration":Array.add(o,a);break;case "scriptBlock":Array.add(v,a);break;case "scriptStartupBlock":Array.add(r,a);break;case "expando":Array.add(B,a);break;case "onSubmit":Array.add(z,a);break;case "asyncPostBackControlIDs":k=a;break;case "postBackControlIDs":n=a;break;case "updatePanelIDs":s=a;break;case "asyncPostBackTimeout":l=a;break;case "childUpdatePanelIDs":m=a;break;case "panelsToRefreshIDs":p=a;break;case "formAction":x=a;break;case "dataItem":Array.add(y,a);break;case "dataItemJson":Array.add(t,a);break;case "scriptDispose":Array.add(q,a);break;case "pageRedirect":if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var f=document.createElement("a");f.style.display="none";f.attachEvent("onclick",A);f.href=a.content;this._form.parentNode.insertBefore(f,this._form);f.click();f.detachEvent("onclick",A);this._form.parentNode.removeChild(f);function A(a){a.cancelBubble=true}}else window.location.href=a.content;return;case "error":this._endPostBack(this._createPageRequestManagerServerError(Number.parseInvariant(a.id),a.content),g,null);return null;case "pageTitle":document.title=a.content;break;case "focus":this._controlIDToFocus=a.content;break;default:this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_UnknownToken,a.type)),g,null);return null}}return {executor:g,updatePanelNodes:w,hiddenFieldNodes:u,arrayDeclarationNodes:o,scriptBlockNodes:v,scriptStartupNodes:r,expandoNodes:B,onSubmitNodes:z,dataItemNodes:y,dataItemJsonNodes:t,scriptDisposeNodes:q,asyncPostBackControlIDsNode:k,postBackControlIDsNode:n,updatePanelIDsNode:s,asyncPostBackTimeoutNode:l,childUpdatePanelIDsNode:m,panelsToRefreshNode:p,formActionNode:x}},_processUpdatePanelArrays:function(e,l,n){var d,c,b;if(e){var f=e.length;d=new Array(f);c=new Array(f);b=new Array(f);for(var a=0;a<f;a++){var k=e[a].substr(1),m=e[a].charAt(0)==="t";b[a]=m;d[a]=k;c[a]=this._uniqueIDToClientID(k)}}else{d=[];c=[];b=[]}var i=[],g=[];this._convertToClientIDs(l,i,g);var j=[],h=[];this._convertToClientIDs(n,j,h);return {updatePanelIDs:d,updatePanelClientIDs:c,updatePanelHasChildrenAsTriggers:b,asyncPostBackControlIDs:i,asyncPostBackControlClientIDs:g,postBackControlIDs:j,postBackControlClientIDs:h}},_queueScripts:function(scriptLoader,scriptBlockNodes,queueIncludes,queueBlocks){for(var i=0,l=scriptBlockNodes.length;i<l;i++){var scriptBlockType=scriptBlockNodes[i].id;switch(scriptBlockType){case "ScriptContentNoTags":if(!queueBlocks)continue;scriptLoader.queueScriptBlock(scriptBlockNodes[i].content);break;case "ScriptContentWithTags":var scriptTagAttributes;eval("scriptTagAttributes = "+scriptBlockNodes[i].content);if(scriptTagAttributes.src){if(!queueIncludes||Sys._ScriptLoader.isScriptLoaded(scriptTagAttributes.src))continue}else if(!queueBlocks)continue;scriptLoader.queueCustomScriptTag(scriptTagAttributes);break;case "ScriptPath":if(!queueIncludes||Sys._ScriptLoader.isScriptLoaded(scriptBlockNodes[i].content))continue;scriptLoader.queueScriptReference(scriptBlockNodes[i].content)}}},_registerDisposeScript:function(a,b){if(!this._scriptDisposes[a])this._scriptDisposes[a]=[b];else Array.add(this._scriptDisposes[a],b)},_scriptIncludesLoadComplete:function(e,b){if(b.executor.get_webRequest()!==this._request)return;this._commitControls(b.updatePanelData,b.asyncPostBackTimeoutNode?b.asyncPostBackTimeoutNode.content:null);if(b.formActionNode)this._form.action=b.formActionNode.content;var a,d,c;for(a=0,d=b.updatePanelNodes.length;a<d;a++){c=b.updatePanelNodes[a];var j=document.getElementById(c.id);if(!j){this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel,c.id)),b.executor,b);return}this._updatePanel(j,c.content)}for(a=0,d=b.scriptDisposeNodes.length;a<d;a++){c=b.scriptDisposeNodes[a];this._registerDisposeScript(c.id,c.content)}for(a=0,d=this._transientFields.length;a<d;a++){var g=document.getElementById(this._transientFields[a]);if(g){var k=g._isContained?g.parentNode:g;k.parentNode.removeChild(k)}}for(a=0,d=b.hiddenFieldNodes.length;a<d;a++){c=b.hiddenFieldNodes[a];this._createHiddenField(c.id,c.content)}if(b.scriptsFailed)throw Sys._ScriptLoader._errorScriptLoadFailed(b.scriptsFailed.src,b.scriptsFailed.multipleCallbacks);this._queueScripts(e,b.scriptBlockNodes,false,true);var i="";for(a=0,d=b.arrayDeclarationNodes.length;a<d;a++){c=b.arrayDeclarationNodes[a];i+="Sys.WebForms.PageRequestManager._addArrayElement('"+c.id+"', "+c.content+");\r\n"}var h="";for(a=0,d=b.expandoNodes.length;a<d;a++){c=b.expandoNodes[a];h+=c.id+" = "+c.content+"\r\n"}if(i.length)e.queueScriptBlock(i);if(h.length)e.queueScriptBlock(h);this._queueScripts(e,b.scriptStartupNodes,true,true);var f="";for(a=0,d=b.onSubmitNodes.length;a<d;a++){if(a===0)f="Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, function() {\r\n";f+=b.onSubmitNodes[a].content+"\r\n"}if(f.length){f+="\r\nreturn true;\r\n});\r\n";e.queueScriptBlock(f)}e.loadScripts(0,Function.createDelegate(this,Function.createCallback(this._scriptsLoadComplete,b)),null,null)},_scriptIncludesLoadFailed:function(d,c,b,a){a.scriptsFailed={src:c.src,multipleCallbacks:b};this._scriptIncludesLoadComplete(d,a)},_scriptsLoadComplete:function(f,c){var e=c.executor;if(window.__theFormPostData)window.__theFormPostData="";if(window.__theFormPostCollection)window.__theFormPostCollection=[];if(window.WebForm_InitCallback)window.WebForm_InitCallback();if(this._scrollPosition){if(window.scrollTo)window.scrollTo(this._scrollPosition.x,this._scrollPosition.y);this._scrollPosition=null}Sys.Application.endCreateComponents();this._pageLoaded(false,c);this._endPostBack(null,e,c);if(this._controlIDToFocus){var a,d;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var b=$get(this._controlIDToFocus);a=b;if(b&&!WebForm_CanFocus(b))a=WebForm_FindFirstFocusableChild(b);if(a&&typeof a.contentEditable!=="undefined"){d=a.contentEditable;a.contentEditable=false}else a=null}WebForm_AutoFocus(this._controlIDToFocus);if(a)a.contentEditable=d;this._controlIDToFocus=null}},_splitNodeIntoArray:function(b){var a=b.content,c=a.length?a.split(","):[];return c},_uniqueIDToClientID:function(a){return a.replace(/\$/g,"_")},_updateControls:function(d,a,c,b){this._commitControls(this._processUpdatePanelArrays(d,a,c),b)},_updatePanel:function(updatePanelElement,rendering){for(var updatePanelID in this._scriptDisposes)if(this._elementContains(updatePanelElement,document.getElementById(updatePanelID))){var disposeScripts=this._scriptDisposes[updatePanelID];for(var i=0,l=disposeScripts.length;i<l;i++)eval(disposeScripts[i]);delete this._scriptDisposes[updatePanelID]}this._destroyTree(updatePanelElement);updatePanelElement.innerHTML=rendering},_validPosition:function(a){return typeof a!=="undefined"&&a!==null&&a!==0}};Sys.WebForms.PageRequestManager.getInstance=function(){var a=Sys.WebForms.PageRequestManager._instance;if(!a)a=Sys.WebForms.PageRequestManager._instance=new Sys.WebForms.PageRequestManager;return a};Sys.WebForms.PageRequestManager._addArrayElement=function(a){if(!window[a])window[a]=[];for(var b=1,c=arguments.length;b<c;b++)Array.add(window[a],arguments[b])};Sys.WebForms.PageRequestManager._initialize=function(a,b){Sys.WebForms.PageRequestManager.getInstance()._initializeInternal(a,b)};Sys.WebForms.PageRequestManager.registerClass("Sys.WebForms.PageRequestManager");Sys.UI._UpdateProgress=function(a){Sys.UI._UpdateProgress.initializeBase(this,[a]);this._displayAfter=500;this._dynamicLayout=true;this._associatedUpdatePanelId=null;this._beginRequestHandlerDelegate=null;this._startDelegate=null;this._endRequestHandlerDelegate=null;this._pageRequestManager=null;this._timerCookie=null};Sys.UI._UpdateProgress.prototype={get_displayAfter:function(){return this._displayAfter},set_displayAfter:function(a){this._displayAfter=a},get_dynamicLayout:function(){return this._dynamicLayout},set_dynamicLayout:function(a){this._dynamicLayout=a},get_associatedUpdatePanelId:function(){return this._associatedUpdatePanelId},set_associatedUpdatePanelId:function(a){this._associatedUpdatePanelId=a},_clearTimeout:function(){if(this._timerCookie){window.clearTimeout(this._timerCookie);this._timerCookie=null}},_handleBeginRequest:function(d,c){var a=c.get_postBackElement(),b=!this._associatedUpdatePanelId;while(!b&&a){if(a.id&&this._associatedUpdatePanelId===a.id)b=true;a=a.parentNode}if(b)this._timerCookie=window.setTimeout(this._startDelegate,this._displayAfter)},_startRequest:function(){if(this._pageRequestManager.get_isInAsyncPostBack())if(this._dynamicLayout)this.get_element().style.display="block";else this.get_element().style.visibility="visible";this._timerCookie=null},_handleEndRequest:function(){if(this._dynamicLayout)this.get_element().style.display="none";else this.get_element().style.visibility="hidden";this._clearTimeout()},dispose:function(){if(this._beginRequestHandlerDelegate!==null){this._pageRequestManager.remove_beginRequest(this._beginRequestHandlerDelegate);this._pageRequestManager.remove_endRequest(this._endRequestHandlerDelegate);this._beginRequestHandlerDelegate=null;this._endRequestHandlerDelegate=null}this._clearTimeout();Sys.UI._UpdateProgress.callBaseMethod(this,"dispose")},initialize:function(){Sys.UI._UpdateProgress.callBaseMethod(this,"initialize");this._beginRequestHandlerDelegate=Function.createDelegate(this,this._handleBeginRequest);this._endRequestHandlerDelegate=Function.createDelegate(this,this._handleEndRequest);this._startDelegate=Function.createDelegate(this,this._startRequest);if(Sys.WebForms&&Sys.WebForms.PageRequestManager)this._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();if(this._pageRequestManager!==null){this._pageRequestManager.add_beginRequest(this._beginRequestHandlerDelegate);this._pageRequestManager.add_endRequest(this._endRequestHandlerDelegate)}}};Sys.UI._UpdateProgress.registerClass("Sys.UI._UpdateProgress",Sys.UI.Control);
Type.registerNamespace('Sys.WebForms');Sys.WebForms.Res={"PRM_UnknownToken":"Unknown token: \u0027{0}\u0027.","PRM_MissingPanel":"Could not find UpdatePanel with ID \u0027{0}\u0027. If it is being updated dynamically then it must be inside another UpdatePanel.","PRM_ServerError":"An unknown error occurred while processing the request on the server. The status code returned from the server was: {0}","PRM_ParserError":"The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.\r\nDetails: {0}","PRM_TimeoutError":"The server request timed out.","PRM_ParserErrorDetails":"Error parsing near \u0027{0}\u0027.","PRM_CannotRegisterTwice":"The PageRequestManager cannot be initialized more than once."};
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();

Users online, no membership, eg, improving

0
0

Dear Colleagues (sorry my bad english),

I Implemented the following mechanism for system that show users online in a list, code:
http://www.c-sharpcorner.com/UploadFile/munnamax/whoseonline08042007062609AM/whoseonline.aspx

I made the junction with my system and it worked, but hardly made ??any change, for not understanding the logic very well, because the codes are not discussed.

First, someone who knows this kind of logic? can explain to me about this class WhoseHandler.cs (i dont want use this class, i want integrate the codes in my Default.apsx.cs).

In this example of code link above, when the user will no longer appear as logged in? (I want know if this use the sessions opened to show the users online, i want understand how this work) seen in "WhoseOnline" function the command:

while(whosOln.MoveNext())
{
HttpContext.Current.Response.Write(whosOln.Value +"<br>");
}

Another doubt is that I could make use of the mechanism using and including WhoseHandler.cs in my application, but I think it will be very "frankstein" (eg, I would just include the commands that WhoseHandler.cs on my default.aspx. cs), wanted to integrate better, I'm not used to search codes ready and fit in my projects, I started researching things like this now - and it is a different way of organizing the code I use, I could not adapt very well. Any suggestion is welcome.

detail, I intend to continue with this implementation because it was the only one who found it viable to my system, because i dont use membership.

Thanks in advance.

Saving Uploaded Image To Folder

0
0

Hi all, I am attempting to create a C# version of the drag drop image uploader. Most of the tutorials I have seen on the subject were using  javascript xhr object and php. My problem is after sending the image to the server in the form of an xhr object, I'm not quite sure how to access that image file and save it to the folder of my choice. The following are snippets of javascript for sending an image file from the frontend to the server.

 function upload(file) {
                 xhrObj = new XMLHttpRequest;
                 xhrObj.open('post', 'DragDrop.aspx', true);
                 xhrObj.setRequestHeader('Content-Type', "multipart/form-Data");
                 xhrObj.setRequestHeader('X-File-Name', file.fileName);
                 xhrObj.setRequestHeader('X-File-Size', file.fileSize);
                 xhrObj.setRequestHeader('X-File-type', file.fileType);

                 xhrObj.send(file);
            };

The following is the C# code in the codebehind of DragDrop.aspx which I've tried to use to access the image file and save it to the folder of my choice in Visual Studio:

protected void Page_Load(object sender, EventArgs e)
        {
            Stream input = (Stream)Request.InputStream;

            Bitmap bmp = new Bitmap(input);
            Response.Clear();            
            
            switch(input.GetType().ToString())
            {
                case "jpeg":
                Response.ContentType = "image/jpeg";
                    break;
                case "gif":
                    Response.ContentType = "image/gif";
                    break;
                case "png":
                    Response.ContentType = "image/png";
                    break;
                default:
                    Response.ContentType = "application/octet-stream";
                    break;
            }

            Response.ContentType = "image/jpeg";
            bmp.Save("@'Upload\test1.jpeg'", ImageFormat.Jpeg);
        }

The code throws no error and nothing happens when I drag and drop my image into a DIV which had been designated as a droppable DIV on my webpage. I've already made sure that the javascript is working and that it's not the reason for the upload failure. Please take a look at my code and point out anything that I might be doing wrong. Thanks in advance for your help.

Problem with updateprogress control

0
0

Hi All,

I have the following code on my web page:

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/M.Master"
    CodeBehind="UploadPDFFile.aspx.vb" Inherits="SMS.UPDSMS.WEB.UploadPDFFile" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager><div>
        Please select a .pdf file to upload</div><div>&nbsp;</div><div><asp:FileUpload ID="FileUpload1" name="FileParsed" runat="server" /></div><div>&nbsp;</div><div><asp:UpdatePanel runat="server" ID="Panel1" UpdateMode="Conditional"><ContentTemplate><div><asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="Panel1"><ProgressTemplate><div id="dvProgress" runat="server" style="position: absolute; top: 300px; left: 550px;
                                text-align: center;"><asp:Image ID="Image2" runat="server" Height="46px" Width="47px" ImageUrl="../../Images/Progress.gif" /></div>
                            Please wait to retrieve data...</ProgressTemplate></asp:UpdateProgress><asp:Button ID="btnUpload" Text="Upload" runat="server" Style="height: 26px" />&nbsp;<asp:Button ID="btnViewData" Text="View Parsed Data" runat="server" />&nbsp;<asp:Button ID="btnDeletedata" Text="Delete Existing Uploaded Files" runat="server" />&nbsp;</div></ContentTemplate></asp:UpdatePanel></div><div>&nbsp;</div><div>
        Please select a Listing .xls file to upload</div><div>&nbsp;</div><div><asp:FileUpload ID="FileUpload2" name="FileParsed" runat="server" /></div><div>&nbsp;</div><div><asp:UpdatePanel runat="server" ID="Panel2"><ContentTemplate><asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="Panel2"><ProgressTemplate><img src="../../Images/Progress.gif" alt="Animated gif file" />Please wait...</ProgressTemplate></asp:UpdateProgress></div><div>&nbsp;</div><div><asp:Button ID="BtnExcelFile" Text="Upload" runat="server" Style="height: 26px" />&nbsp;<asp:Button ID="BtnListing" runat="server" Text="View Section Listing Data"
                    Style="height: 26px" /></div></ContentTemplate></asp:UpdatePanel></asp:Content>

I want to see the updateProgress control when I click on the btnUpload or btnViewData or btnDeletedData or any other button present on the web page but I don't see a updateProgress control at all.

any help will be appreciated.

 

 

 

why my accordion can't switch between panel on client click?

0
0
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Test.Default" EnableViewState="true" %><%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:Accordion ID="Accordion1" runat="server" RequireOpenedPane="true" SelectedIndex="0"
            FadeTransitions="true" ><Panes><asp:AccordionPane runat="server" ID="AccordionPane1"><Header>h1</Header><Content>c1</Content></asp:AccordionPane><asp:AccordionPane runat="server" ID="AccordionPane2"><Header>h2</Header><Content>c2</Content></asp:AccordionPane><asp:AccordionPane runat="server" ID="AccordionPane3"><Header>h3</Header><Content>c3</Content></asp:AccordionPane><asp:AccordionPane runat="server" ID="AccordionPane4"><Header>h4</Header><Content>c4</Content></asp:AccordionPane></Panes></asp:Accordion></form></body></html>

The displayed result is

<div id="AccordionPane1_header">h1</div> <div id="AccordionPane1_content" style="display: block;">c1</div> <div id="AccordionPane2_header">h2</div> <div id="AccordionPane3_header">h3</div> <div id="AccordionPane4_header">h4</div> <div></div>

I can't switch between each panel by clicking h1/h2/h3/h4

What's wrong here?

Trigger Control Inside GridView ItemTemplate

0
0

Hi all

I have an UpdatePanel: uplVirtual_Work that contains a GridView: gvwVirtual_Work. The GridView has a TemplateField that contains an Image ButtonigbDelete_VW.

The function of the igbDelete_VW is delete a row from the the grid view gvwVirtual_Work.

<asp:UpdatePanel ID="uplVirualWork" runat="server"><ContentTemplate><asp:GridView runat="server" ID="gvwVirtual_Work" AutoGenerateColumns="False" ShowHeader="False"><Columns><asp:BoundField DataField="Sno" HeaderText="م" ItemStyle-Width="3%" ></asp:BoundField>
             .........
             .........
             .........<asp:TemplateField ItemStyle-Width="4%" ItemStyle-HorizontalAlign="Center"><ItemTemplate><asp:ImageButton ID="igbDelete_VW" runat="server" ImageUrl="~/images/Del_Circle.png"
                  CommandName="igbDelete_V" CommandArgument="<%# CType(Container, GridViewRow).RowIndex%>"  /></ItemTemplate></asp:TemplateField></Columns></asp:GridView></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="igbDelete_VW" EventName="Click" /></Triggers></asp:UpdatePanel>



Protected Sub gvwVirtual_Work_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvwVirtual_Work.RowCommand
        Dim index As Integer = Convert.ToInt32(e.CommandArgument)
        gvwVirtual_Work.DeleteRow(index)
End Sub

When I run the code I get the following Error:

Server Error in '/' Application.


A control with ID 'igbDelete_VW' could not be found for the trigger in UpdatePanel 'uplVirualWork'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

ajax Accordion Selected index not working and find('...') is null

0
0

I have two problems.

First

<ajax:AccordionPane ID="accPanePsalmsChapter1" runat="server" RequireOpenedPane="false" SuppressHeaderPostbacks="true" FadeTransitions="true"  SelectedIndex="-1">

SelectedIndex does not work.  Setting it to -1 or 0 does nothing.  After page is loaded the selected index is always the last pane.

If I set Selected index on the back side in Page_Load then it works.  But I should not have to.

Second

I have simple javascript that I have always used in prior sites and never had a problem. but in this case my accordion is always null.

the javascript

function setPaneIndex(accordionID, paneIndex) {
    var acer = $find(accordionID + "_AccordionExtender");
    if (acer != null && acer != "") { acer.set_SelectedIndex(acer.get_SelectedIndex() == paneIndex ? -1 : paneIndex); }
}
function getPaneIndex(accordionID) {
    return $find(accordionID + "_AccordionExtender").get_SelectedIndex();
}

the code on the page.

<ajax:Accordion ID="accPsalms" runat="server" SelectedIndex="1" RequireOpenedPane="false" ><Panes><ajax:AccordionPane ID="accPanePsalmsChapter1" runat="server" RequireOpenedPane="false" SuppressHeaderPostbacks="true" FadeTransitions="true" TransitionDuration="50" FramesPerSecond="30" SelectedIndex="-1"><Header>
                    Chapter 1<hr /></Header><Content><ol><li>item 1</li><li>item 2</li></ol></Content></ajax:AccordionPane><ajax:AccordionPane ID="accPanePsalmsChapter2" runat="server"><Header>
                    Chapter 2<hr /></Header><Content><ol><li>item 1</li><li>item 2</li></ol></Content></ajax:AccordionPane></Panes></ajax:Accordion><script>$(function () {
           // var query = getQueryParams(document.location.search);

           // if (query.v != "" && query.c != "") {

                setPaneIndex('<%= accPsalms.ClientID %>', 0);
           // }
        });</script>


Problem with Calendar Extender

0
0

I have the Calendar Extender from the Ajax Control Toolkit installed and running in Project1. I also want to use it in Project 2. I have added the same reference and the same markup code but in Project 2 I get this error.

Server Error in '/' Application.

Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "AjaxControlToolkit.Properties.Resources.NET4.resources" was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time, or that all the satellite assemblies required are loadable and fully signed. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "AjaxControlToolkit.Properties.Resources.NET4.resources" was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time, or that all the satellite assemblies required are loadable and fully signed.

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 



[MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "AjaxControlToolkit.Properties.Resources.NET4.resources" was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time, or that all the satellite assemblies required are loadable and fully signed.]
   System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName) +311
   System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) +993
   System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) +810
   System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +34
   System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +427
   AjaxControlToolkit.Properties.Resources_NET4.get_E_NoScriptManager() +59
   AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) +757
   AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) +62
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

  


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237  

Can someone suggest a fix? Thanks

What are the Causes of 500 Internal Server Error

0
0

Hi all, I am trying to send an image with a content-type of  multipart/form-data to a webservice but got a 500 Internal Server Error. The following is my Javascript function to send the image and receive a status message from the webservice.

                 xhr = new XMLHttpRequest();
                 xhr.open('post', 'http://localhost:26692/SavePicService.asmx?op=SaveImage', true);
                 //xhr.setRequestHeader('Content-Type', "multipart/form-Data");
                 xhr.setRequestHeader('Content-Type', "application/x-www-form-urlencoded");
                 xhr.setRequestHeader('X-File-Name', file.fileName);
                 xhr.setRequestHeader('X-File-Size', file.fileSize);
                 xhr.setRequestHeader('X-File-type', file.fileType);

                 xhrObj.send(file);

                 var responseObject = xhr.responseText;
                 alert(responseObject); // ------- Test status of upload

This is a simple webserivce to test if data is successfully being received and response is sent back by webservice.

namespace myNameSpace
{
    /// <summary>
    /// Summary description for SavePicService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    [System.Web.Script.Services.ScriptService]
    public class SavePicService : System.Web.Services.WebService
    {

        [WebMethod]
        public string SaveImage()
        {           

            return "Data Transfer Successful!";
        }
    }
}

At first my content-type was set to "multipart/form-Data" in my javascript upload function but I got the 500 internal service error. After doing some digging online I came across an article that says that the content-type must be set to "application/x-www-form-urlencoded" or the 500 internal server error will be thrown. Needless to say, that still results in the same error.  Please point out where I went wrong in my code, thanks in advance.

Using Inside an UpdatePanel

0
0
Hi, everyone!

We use a service called FormStack and they allow great form functionality along with many ways to embed a form into a page.

A few of the embedding methods creates the form wishing the page DOM or you can paste the full form into your markup.

Using these methods causes a couple of issues with ASP, namely because the form used a Submit button triggering the page to postback.

This got me thinking: could I wrap FormStack's HTML form in an UpdatePanel? That would then create the form's submit button as a trigger for the panel causing partial page postback, no?

This would then solve any ViewState issues caused by embedding the form within the ASPX template, I think.

Does anyone have any experience with something like this? If so, can you please offer any advise?

Thanks!

-Eric

HoverMenuExtender not working

0
0

I have one Gridview in which I have added a HoverMenuExtender to a Label inside an ItemTemplate.

On page load it works fine.

I have added a ModalPopupExtender to a link button  in the same row. Onclicking the link the  ModalPopupExtender is displayed.

After closing this ModalPopupExtender, the HoverMenuExtender stops working. How can I resolve this?

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

0
0

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

Here is the HTML:

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

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

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

Thanks for any help.

 

AutoCompleteExtender & VB.Net

0
0

Hey All, I've been fighting with this all day. I've read a multitude of tutorials and I can not get the AutoCompletedExtender working.

Here is my aspx page code:

<asp:TextBox ID="brandTXT" runat="server" AutoPostBack="true"></asp:TextBox><asp:AutoCompleteExtender ID="brandTXT_AutoCompleteExtender" runat="server" 
     MinimumPrefixLength="1" CompletionInterval="100" Enabled="True" 
     ServicePath="~/WebService.asmx" EnableCaching="true" 
     CompletionSetCount="20" ServiceMethod="GetCompletionList" TargetControlID="brandTXT"></asp:AutoCompleteExtender>

Here is my WebService.asmx:

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.Data.SqlClient

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<ToolboxItem(False)> _
Public Class WebService
    Inherits System.Web.Services.WebService<WebMethod()> _
    Public Function GetCompletionList(prefixText As String, ByVal count As Integer) As List(Of String)
        Dim ConnStr As String = ConfigurationManager.ConnectionStrings("connectionString").ConnectionString
        Dim CnBKPost As New SqlConnection(ConnStr)

        Dim result As List(Of String) = New List(Of String)

        Dim cmd As New SqlCommand
        cmd.CommandText = "selectBrandByLetter"
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Connection = CnBKPost
        cmd.Parameters.AddWithValue("@brand", prefixText)

        CnBKPost.Open()
        Dim dr As SqlDataReader = cmd.ExecuteReader()
        While dr.Read()
            result.Add(dr("Manufacturer").ToString())
        End While
        CnBKPost.Close()
        Return result
    End Function
End Class

The stored procedure is a simple select statement

SELECT dbo.Inventory.Manufacturer
	FROM dbo.Inventory
	WHERE dbo.Inventory.Manufacturer LIKE @brand + '%'
	GROUP BY dbo.Inventory.Manufacturer
	ORDER BY dbo.Inventory.Manufacturer

I can run the stored procedure perfectly with proper results, and I can run a test page with returning the results in a button click command. So I know everything on the database end of things is working fine.

I've added my service reference for the WebService.asmx page as well to my solution.

There are no errors, just nothing happens on the page at all...

I am stumped, any help would be great!

popping up wrong modalpopup window

0
0

I have a web page which has multiple modal popup windows.  The popup is being triggered from a codebehind page based on a button click event.   The code behind reads from the form dropdown and depending on which item is selected in the dropdown a different modal window is supposed to display.  When running in the debugger, I can  see that the correct modal is called either CompleteEventPopupExtender.Show(); or CancelEventCommmentPopupExtender.Show();  but the same panel displays for both of these.  the one that displays is the panel that is written 1st in the .aspx page.  Each modal is in its own panel with its own names.  I have tried adding div tags to the panels, updatePanel to the panels, but nothing seems to be working.

Here is the code for the .aspx page:

<tr><td><asp:Label ID="StatusLabel" runat="server"></asp:Label><asp:DropDownList ID="StatusDropdown" runat="server" AutoPostBack="true" DataSourceID="EventStatusDataSource" DataTextField="Name" DataValueField="ID" OnSelectedIndexChanged="StatusDropDownList_SelectedIndexChanged" /><asp:Panel ID="CancelEventCommentPanel" runat="server" ScrollBars="Auto" Style="display: none;
                                    border: solid 1px gray; padding: 20px; background-color: #FDF0DD; margin: 0px;
                                    width: 300px; height: 250px;"><asp:UpdatePanel ID="CancelEventUpdatePanel" runat="server" UpdateMode="Conditional"><ContentTemplate><table><tr><td align="left"><asp:Image ID="Image2" runat="server" ImageUrl="~/Images/error.png" />
                        Please enter a comment explaining why the event has been Cancelled.<asp:RequiredFieldValidator ID="CancelledCommentRequiredFieldValidator" runat="server" ControlToValidate="CancelCommentTextBox" ErrorMessage="* You must enter a comment" ValidationGroup="CancelCommentValidationGroup"></asp:RequiredFieldValidator><textarea id="CancelCommentTextBox" runat="server" cols="75" onchange="javascript:setCharsRemainingCancelledComment(this)" onkeyup="javascript:setCharsRemainingCancelledComment(this)" rows="5" style="width: 100%"></textarea> <span class="charsRemainingBox"><asp:TextBox ID="CancelCommentCounter" runat="server" Columns="5" ReadOnly="True" TabIndex="500"></asp:TextBox>&nbsp;Characters Remaining </span><br /><br /><asp:Button ID="ConfirmCancelAction_Button" runat="server" CausesValidation="true" OnCommand="SaveEvent_Click" Text="OK" ValidationGroup="CancelCommentValidationGroup" /><asp:Button ID="Button1" runat="server" CausesValidation="false" Text="Cancel" /></td></tr></table></ContentTemplate></asp:UpdatePanel></asp:Panel><cc1:ModalPopupExtender ID="CancelEventCommmentPopupExtender" runat="server" BackgroundCssClass="modalBackground" PopupControlID="CancelEventCommentPanel" PopupDragHandleControlID="labeldrag" TargetControlID="LinkButton2"></cc1:ModalPopupExtender><asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false"></asp:LinkButton><asp:Panel ID="CompleteEventPanel" runat="server" ScrollBars="Auto" Style="display: none;
                                    border: solid 1px gray; padding: 20px; background-color: #FDF0DD; margin: 0px;
                                    width: 300px; height: 250px;"><asp:UpdatePanel ID="CompleteEventUpdatePanel" runat="server" UpdateMode="Conditional"><ContentTemplate><table><tr><td align="left"><asp:Image ID="Image3" runat="server" ImageUrl="~/Images/error.png" />
                                                    After the event has been completed, you will no longer be able to make changes.<br />
                                                    Do you want to continue?<br /><br /><asp:Button ID="ConfirmCompleteEvent" runat="server" CausesValidation="false" OnCommand="SaveEvent_Click" Text="OK" /><asp:Button ID="Button3" runat="server" CausesValidation="false" Text="Cancel" /></td></tr></table></ContentTemplate></asp:UpdatePanel></asp:Panel><cc1:ModalPopupExtender ID="CompleteEventPopupExtender" runat="server" BackgroundCssClass="modalBackground" PopupControlID="CompleteEventPanel" PopupDragHandleControlID="labeldrag" TargetControlID="LinkButton3"></cc1:ModalPopupExtender><asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false"></asp:LinkButton></td></tr>

Here is the code behind page:

        protected void SaveEvent_Click(object sender, EventArgs e)
        {

            // Get the selected EventStatus from the Status dropdown menu
            EventStatus selectedStatus =
                EventManager.resolveEventStatus(Convert.ToInt32(StatusDropdown.SelectedValue));

            bool statusChangedToCancelled = false;
            bool statusChangedToCompleted = false;


            if (selectedStatus == EventStatus.Cancelled || selectedStatus == EventStatus.Completed)
            {
                EventInformation info = new EventInformation(EventID);
                EventStatus previousStatus = EventManager.resolveEventStatus(info.EventStatusID);
                if (previousStatus != EventStatus.Cancelled)
                {
                    statusChangedToCancelled = true;
                }
                else if (previousStatus != EventStatus.Completed)
                {
                    statusChangedToCompleted = true;
                }
            }

            // If the state has changed to "Cancelled", prompt the user to submit a comment
            if (statusChangedToCancelled &&
                string.IsNullOrEmpty(CancelCommentTextBox.Value))
            {
                // Prompt the user to submit a comment
                CancelEventCommmentPopupExtender.Show();
            }

            // If the state has changed to "Completed", prompt the user to continue
            else if (statusChangedToCompleted)
            {
                // Prompt the user to submit a comment
                CompleteEventPopupExtender.Show();

            }

What am I doing wrong?

Thanks in advance!


Complete Extender

0
0

I have created AutoCompleteExtender and showing Employee_Id-EMployee_Name combination.

Is there a way to store only EMployee_ID in database. It is storing employee_id-Employee_Name

Cancel page refresh

0
0

Hi,

I have an "export to excel" image button.

When I click on it I run a codebehind function to export a gridview to excel.

<asp:ImageButton ID="excel" runat="server" Height="25px" OnClick="btnExportToExcel_Click"
                            ImageUrl="~/Images/excel.png" ToolTip="Export to Excel"/>

The problem is that the entire page refreshes and I would like to avoid that.

The imagebutton is inside an update panel and it is not one of it's triggers.

I have to postback to server to run the function  but I can't seem to avoid the refresh.

Do I need to add another updatepanel? solve it with javascript?

Required Field Validator in Ajax Accordion Pane is not working

0
0

We using Ajax Accordion pane. We dynamically binding ajax accordion from data set. So we not sure how much pane wil be bind.
 
Now we added few textbox and 1 button in each accordion pane which is mandotory so we used required field validator.
 
The problem is when i click buton in first pane textbox in first pane showing "It is required" which is fine but even if i typed textbox in first pane. I am not able to save since textbox in remaining pane showing "It is required". Please guide me.

<cc1:AccordionID="accRcvDetails"runat="server"SelectedIndex="-1"ContentCssClass="accordion-content"RequireOpenedPane="false"HeaderCssClass="accordion-header"HeaderSelectedCssClass="accordionSelected"OnItemCommand="accRcvDetails_ItemCommand"OnItemDataBound="accRcvDetails_ItemDataBound"> <HeaderTemplate></HeaderTemplate><ContentTemplate><tdclass="searchlabel"><asp:LabelID="lblNotes"runat="server"Text="Notes:"></asp:Label></td><tdclass="searchtext"colspan="3"><asp:TextBoxrunat="server"ID="txtNotes"Width="100%"TextMode="MultiLine"Height="35px"/><asp:RequiredFieldValidatorControlToValidate="txtNotes"Text="Note Field is Required"runat="server"/></td><td><tdstyle="text-align: right"colspan="8"><asp:ButtonID="btnSave"CssClass="searchbutton Accbtnsave"runat="server"CommandName="Save"Text="Save"/></td></ContentTemplate> </cc1:Accordion>

megamenu in ajax

0
0

hi Im looking for mega menu in ajax asp.net, it needs to be used in ecommerce store..

Appreciate any help thanks

pagemethods returns html string (from masterpage?)

0
0

Hi,

I have managed to set up a call to a function in codebehind through pagemethods. It return a success but instead of the test string (Hello) it returns a html string that seems to be a small part of the masterpage. What am I missing/doing wrong?

    function ShowCurrentTime() {
            PageMethods.Hello(Success, Failure);
    }

    function Success(result) {
        alert(result);
    }
    function Failure(error) {
        alert(error);
    }

code behind:

<WebMethod()>
    Public Shared Function Hello() As String
        Dim SayHello As String = "Hello"
        Return SayHello
    End Function

Thanks in advance,

Pascal

Viewing all 5678 articles
Browse latest View live




Latest Images