asp.net-ajax

asp.net Refresh base page from iframe

我与影子孤独终老i 提交于 2019-12-04 13:49:33
I have page with other asp.net page inside iframe. And on button click inside iframe i need to refresh main page from server side. How can it? Make use of javascript and you can easily do it call the following function on your button click <script language="javascript"> function RefreshParent() { window.parent.location.href = window.parent.location.href; } </script> From the cs code if you are opening the aspx page in the iframe Page.RegisterStartupScript("RefreshParent","<script language='javascript'>RefreshParent()</script>"); Its explained very well in the following links: link 1 link 2

ASP.NET Ajax client-side framework failed to load .net 4.0

元气小坏坏 提交于 2019-12-04 12:41:46
问题 Good Evening, I am experiencing a strange problem. I only experience the problem when the site has been deployed to IIS 7.0. The web page renders fine when launched in VS 2010; however when viewed to IIS 7.0 the entire page gets shifted to the right. errors only happen when this is on the .aspx page <telerik:RadScriptManager ID="RadScriptManager" runat="server" /> Web.config file below.... Please let me know if you need anything else. Thanks, Brennan Web.config --- <authentication mode="Forms

How to send/ Upload file without using FORMDATA in jquery ajax

余生长醉 提交于 2019-12-04 11:18:38
How to send/Upload file without using FORMDATA in jquery ajax? Because IE does not support FORMDATA... here is the working code... $(document).ready(function () { $("#btnUpload").on("click", function () { var file_data = $("#UploadedFile").prop("files")[0]; // Getting the properties of file from file field var form_data = new FormData(); // Creating object of FormData class form_data.append("file", file_data) // Appending parameter named file with properties of file_field to form_data form_data.append("user_id", 123) // Adding extra parameters to form_data $.ajax({ url: "/User/UpdateImages",

Countdown timer on ASP.NET page

跟風遠走 提交于 2019-12-04 10:40:39
Could you recommend me a way to place a coundown timer on ASP.NET page? Now I use this code: Default.aspx <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server">60</asp:Label> <asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick"> </asp:Timer> </ContentTemplate> </asp:UpdatePanel> Default.aspx.cs protected void Timer1_Tick(object sender, EventArgs e) { int seconds = int.Parse(Label1.Text); if (seconds > 0) Label1.Text = (seconds - 1).ToString();

MVC Ajax.ActionLink doesn't find POST method

心已入冬 提交于 2019-12-04 09:29:52
问题 I have a POST method declared in my controller: [AcceptVerbs(HttpVerbs.Post)] public ActionResult UpdateComments(int id, string comments) { // ... } and an ActionLink in my view: <%= Ajax.ActionLink("update", "UpdateComments", new { id = Model.Id, comments = "test" }, new AjaxOptions { HttpMethod="POST", OnFailure="alert('fail');", OnSuccess = "alert('success');" })%> I get a "not found" error when it tries to route this request. If I remove the POST restriction from the UpdateComments method

Ajax.BeginForm helper not loading partial view into specified DIV

試著忘記壹切 提交于 2019-12-04 09:03:05
I am working with MVC trying to load the results of a form submission into a specific DIV. Below is the code of my form: <div class="segmentForm clearfix"> <% using (Ajax.BeginForm("ShopByAirCriteria", "AirOption", new AjaxOptions { UpdateTargetId = "DynamicAirOptions", InsertionMode = InsertionMode.Replace, HttpMethod = "POST", OnBegin = "return loadingBar();" }, new { @name = "AirOptionSegment_Air" })) { %> <% Html.RenderPartial("AirOneWay", Model); %> <br/> <div class="agent-actions"> <a href="" class="btn blue" style="margin-right: 25px;">Load Original Data</a> <input type="submit" class=

Updated ASP.NET 3.5 to 4.0 -> Sys.WebForms.PageRequestManager is undefined

ε祈祈猫儿з 提交于 2019-12-04 08:31:18
As the title indicates, I recently updated an ASP.NET 3.5 application containing UpdatePanels and similar AJAX technologies to ASP.NET 4.0. Unfortunately, the UpdatePanels work no more and full page postbacks makes it all go south. Web.config-file <?xml version="1.0"?> <configuration> <configSections> <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"/> <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging

AJAX - How to Pass value back to server

爷,独闯天下 提交于 2019-12-04 08:05:36
First time working with UpdatePanels in .NET. I have an updatepanel with a trigger pointed to an event on a FormView control. The UpdatePanel holds a ListView with related data from a separate database. When the UpdatePanel refreshes, it needs values from the FormView control so that on the server it can use them to query the database. For the life if me, I can't figure out how to get those values. The event I'm triggering from has them, but I want the updatepanel to refresh asynchronously. How do I pass values to the load event on the panel? Googled this ad nauseum and can't seem to get to an

ASP.NET AJAX Progress Bar: Update from Code Behind?

不打扰是莪最后的温柔 提交于 2019-12-04 07:09:56
I have an Import function for an Excel spreadsheet within an application. It uses the FileUpload control at the moment. I upload the file, then run an operation on that file. I want to inform the user of the operation being done, and the percentage that is done. I figure that I can take the total number of rows I extracted from the Excel spreadsheet, and continuously divide as I insert each record into the database and update a progress bar. The problem is that I can't seem to find any solution that updates a progress bar from the Code Behind. I tried using Matt Berseth's solution . It's very

How do I server AJAX calls using JSON with Web Forms?

六月ゝ 毕业季﹏ 提交于 2019-12-04 06:51:46
I know MVC controllers are quite good at serving JSON formatted AJAX requests, but is there any built-in ASP.NET functionality I can use for these type calls from a plain old web forms site? VladV You could use built-in ASP.NET AJAX. Option 1 - use a web service (if you want the functionality to be reusable): create a web service (.asmx) with [ScriptService] attribute, add a to your page and add the web service to its Services collection, use JavaScript proxy generated by ScriptManager in yor page. Option 2 - use page methods (if you want the functionality on a single page without creating a