asp.net-ajax

posting JSON to MVC controller - String parameter is null

五迷三道 提交于 2019-12-02 13:36:54
问题 I am intentionally trying NOT to use a binding in the controller parameter, so I have a controller that looks like: [HttpPost] public ActionResult UntypedForm(String serializedformdata) { //// ... } When I post serialized JSON form elements to the controller with the below code: var formelements = $('#form').serializeArray(); $.post(url, formelements, function (data) { }, "json").error(function () { alert("Error posting to " + url); }); I get a NULL value for String serializedformdata on my

c# updatepanel with timer page_load

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 12:16:45
问题 I'm experimenting with some AJAX now. I have a custom control which appears on my masterpage in which there is an update panel and a timer. The timer fires and the panel updates and everything is dandy. Except that there are some operations that I don't want it to perform on every refresh. It seems like the entire page lifecycle happens with each refresh. There are variables I want to set, and keep their value on the refresh. Is there a way to make it perform ONLY what's in the timer_tick

ASP timer Control is refreshing the whole page?

久未见 提交于 2019-12-02 11:25:50
问题 I have a ASP timer control which is supposed to run every three minutes. Although I kept the Timer control in an update panel, it is refreshing the whole page every time it runs. Is there any it only refresh the particular section of the page, not the whole page? <div> <asp:UpdatePanel ID="UpdatePanel4" runat="server"> <ContentTemplate> <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="300000" > </asp:Timer> </ContentTemplate> </asp:UpdatePanel> </div> 回答1: <asp:Timer runat

ASP.NET AJAX $find method failes when used in jQuery's $(document).ready() method

时间秒杀一切 提交于 2019-12-02 10:54:29
I'm trying to find a tree using ASP.NET AJAX's client-side framework. I also use jQuery for doing any JavaScript operation after the DOM is ready. my code is like: $(function(){ var tree = $find('treeId'); }); Here, tree simply is null. But when I try to find the tree on click of one of elements, it's not null: $(function(){ $('saveButton').click(function(){ var tree = $find('treeId'); }): }); this worked for me with Telerik controls: $telerik.$(document).ready(function () { var tree = $telerik.$find("<%=RadTreeView1.ClientID%>"); }); see this http://www.telerik.com/help/aspnet-ajax

Google pie chart (any chart) not working inside an ASP.Net AJAX Update Panel

一世执手 提交于 2019-12-02 10:47:14
I am facing problem with Google pie chart and Update panel. Their is one Tab container inside a update panel which has two Tab panels. Each tab panel contains div and script to plot Google pie chart. when first time page gets load it works properly. but if i change the tab then pie chart doesn't work. i have used "Sys.Application.add_load(methodname) inside each tab panel. i have used script which is in Google play. Thanks in Advance. The call to google.load only loads the Visualization API and fires a callback the first time it is called only. Subsequent calls to google.load for the same

Add asp.net dropdownlist item from JavaScript causes page postback error

梦想与她 提交于 2019-12-02 09:48:49
The design is: all elements are in an updatepanel . click on a list of <tr> to fire a JavaScript function to add new <option> to the asp dropdownlist . But, when I click on other buttons to callback to the server, I get an error message: Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate

Help with structure for “single-page” Ajax website

感情迁移 提交于 2019-12-02 09:37:52
I know about the rules and this is not really a question that can be answered, but I really need help with this. I'm making a website that have a javascript music player that cannot be interrupted every time the user changes between pages. So, the site must be a sort of single page, loading the ASPX files with AJAX. What structure should I use for this? If I use a Masterpage with the player and separated aspx files, will I be able to load these files with ajax? Any help with structure or an ajax sample would be appreciated. I would suggest you leverage the MVC Framework for this. You can then

How to solve duplicate objects in dynamic loading page by using jQuery?

倾然丶 夕夏残阳落幕 提交于 2019-12-02 09:34:55
问题 I want to solve duplicate objects in dynamic loading content. Please look at the following source code for easier understand. Base Page HTML With 1 Dynamic Loading Content <body> <div id="general-div"></div>> <div id="div1"></div> <div id="placeholder1"> Dynamic Content will be placed inside this. <div class="inner-div"></div> <div class="div1"></div> </div> </body> For script in header of this page, it's very easy to select "general-div" object like the following code. $('#general-div') It's

how to set label text inside listview from code behind

旧城冷巷雨未停 提交于 2019-12-02 08:13:16
Actually i'm developing a web template with asp.net using c# and my connection string is: <connectionStrings> <add name="NorthwindConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SecurityTutorials.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings> and by using below code from code behind i have connected to the data base: using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\SecurityTutorials.mdf

How to solve duplicate objects in dynamic loading page by using jQuery?

谁都会走 提交于 2019-12-02 08:10:36
I want to solve duplicate objects in dynamic loading content. Please look at the following source code for easier understand. Base Page HTML With 1 Dynamic Loading Content <body> <div id="general-div"></div>> <div id="div1"></div> <div id="placeholder1"> Dynamic Content will be placed inside this. <div class="inner-div"></div> <div class="div1"></div> </div> </body> For script in header of this page, it's very easy to select "general-div" object like the following code. $('#general-div') It's quite easy for select "inner-div" object inside placeholder1. So I can select by using the below code.