asp.net-ajax

Dynamic Controls and Postback

拜拜、爱过 提交于 2019-11-29 13:04:49
I have a Panel. Now in that panel, i'm adding controls. It is getting added and displayed.The problem is when the page is posted back.I know the controls have to be binded again in the panel. But lets say if the user has entered some value in the dynamic created text box. Its is getting lost.. I have done this before by storing the data from the controls in session. Every time you dynamically add a control, store the current data entered into the controls in session or viewstate for example, and then rebind on postback. Not the most elegant solution but it worked. I take it this is a webforms

“Invalid Character in Base-64 String” using ASP.NET and C#

匆匆过客 提交于 2019-11-29 11:55:05
I'm having this problem on posting a page. The page have a jquery ajax load called by the onchange of a dropdownlist, if I disable the onchange, the post works. "The state information is invalid for this page and might be corrupted" [FormatException: Invalid character in a Base-64 string.] System.Convert.FromBase64String(String s) +0 System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +72 System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4 System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String

CrossPostback ,AJAX Controls and ASP.NET generated postbacks work for .NET 4.5 , not .NET 4.0 in IE 11

℡╲_俬逩灬. 提交于 2019-11-29 11:04:51
I had posted and answered the question earlier. WebResource.axd not working with Internet Explorer 11 But I thought the hotfix had fixed the issue(CrossPostback ,AJAX Controls and ASP.NET generated postbacks not working) but after installing in QA , it didn't work and we realized it was .NET 4.5 that made things work . I am under the process of comparing .NET frameworks folder between .NET 4 and .NET 4.5. What I needed to ask what could in .NET 4.5 really resolve the IE 11 issue. The major change in IE 11 is the user agent string. What particular fix in .NET 4.5 could have resolved the

Using GridView inside UpdatePanel

China☆狼群 提交于 2019-11-29 10:16:14
I have an Updatepanel and Gridview inside it. <asp:UpdatePanel ID="uplPanel" UpdateMode="Conditional" runat="server" OnLoad="uplPanel_Load"> <ContentTemplate> <asp:GridView ID="gvPrList" runat="server" AutoGenerateColumns="false" AllowPaging="false" AllowSorting="false" CssClass="list-table" HeaderStyle-CssClass="header"> <Columns> <ItemTemplate> <asp:Button ID="btnEdit" runat="server" Text="Edit" CssClass="button save" OnCommand="onPrItemCmd" CommandName="editRow" CommandArgument='<%#Bind("ID") %>' Style="width: 80px" /> <asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="button

CalendarExtender wrongly positioned after scrolling

感情迁移 提交于 2019-11-29 09:50:07
I am adding a CalendarExtender to a page, using the default styles. When I click the calendar button to trigger the calendar popup, the calendar displays normally. However, when I scroll down and click the button again, the calendar's position is not where it should be, as seen below. Why is this occuring and how do I fix it? EDIT: A bit about the implementation of this page. The CalendarExtender and TextBox are part of a WebPart added to a SharePoint 2007 Page. I am creating the extender like so: textBox = new TextBox() { ID = "textBox" }; Controls.Add(textBox); calendar = new

ASP.NET Validators inside an UpdatePanel

泄露秘密 提交于 2019-11-29 09:20:23
I'm using an older version of ASP.NET AJAX due to runtime limitations, Placing a ASP.NET Validator inside of an update panel does not work. Is there a trick to make these work, or do I need to use the ValidatorCallOut control that comes with the AJAX toolkit? I suspect you are running the original release (RTM) of .NET 2.0. Until early 2007 validator controls were not compatible with UpdatePanels. This was resolved with the SP1 of the .NET Framework. The source of the problem is that UpdatePanel can detect markup changes in your page, but it has no way to track scripts correctly. Validators

What causes the 'Cannot unregister UpdatePanel' error?

我只是一个虾纸丫 提交于 2019-11-29 06:12:28
I've got a UserControl that contains an UpdatePanel. When I put that on a page, it throws the following error: Cannot unregister UpdatePanel with ID 'ReviewContentUpdatePanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel ReviewContentUpdatePanel is the name of the update panel & it's not being removed or added in code, it exists in the aspx page and isn't removed. Has anyone come across this before? This error occurs when the Controls

Server-side ASP.Net Ajax exception handling

老子叫甜甜 提交于 2019-11-29 04:35:36
I am using ASP.net's AJAX framework and I am trying to do some exception logging on the javascript-called webservice. Looking through the web, I find some people handling them client-side and sending them back to the server. I'd prefer not doing that since it relies on an other server call (if it failed the first time, sending an other request doesn't look like a good idea and that makes me change all my calls) I see some other people decorating all their methods with try... catch blocks (which leads to duplicate error handling, and yet an other try catch block). However, I'm trying to achieve

How to update a div with Ajax.BeginForm AND execute a javascript function?

我们两清 提交于 2019-11-29 03:59:32
I am updating a div with a partial view by using something like this: <% using (Ajax.BeginForm("Action", "Controller", new { id=Model.id }, new AjaxOptions { UpdateTargetId = "divId", InsertionMode = InsertionMode.InsertAfter, })) { %> and its working fine, the returned view gets appened to the div, however I now need to execute a javascript when the post is successful, so I thought: "easy, just add OnSuccess = "MyJsFunc()" " to the AjaxOptions , but after doing this, it stopped working! now the page is refreshed and only the returned partial view is rendered :(, I even tried with a simple

Post form data to Controller's action with Ajax

淺唱寂寞╮ 提交于 2019-11-29 03:41:10
问题 I have a page in MVC3, with a link (Ajax.ActionLink). When user clicks it, it calls controller's action, and the result is inserted into a div, with replace. Code is shown below: @Ajax.ImageActionLink("/Images/btn_share.png", "Share pool", "SharePool", new { poolKey = Model.Id, poolName = Model.Name }, new AjaxOptions { UpdateTargetId="popup", HttpMethod="GET", InsertionMode = InsertionMode.Replace, LoadingElementId="loading_dialog", OnSuccess = "ShowPopup('#popup_share', true, true)" }