asp.net-ajax

How to return data from model in textfields with Ajax call?

99封情书 提交于 2019-12-13 03:31:48
问题 I am using asp.net mvc And I have a login model with three fields: -baliecode -username -password So every balie code correspondents with a username and password. And now I try to get the username and password in the texfields if a user has entered a baliecode an press TAB. The action method looks likes this: [AcceptVerbs(HttpVerbs.Post)] public JsonResult GetLogindetails(V_LoginModel_BalieUser model) { ISalesPersonProfile salesAgent99 = CommerceFrameworkBase.SalesPersons.GetSalesPerson("HD")

Error: [Exception… “Access to restricted URI denied” … while calling $.ajax method

↘锁芯ラ 提交于 2019-12-13 03:29:43
问题 I am getting this error while calling $.ajax methods Error: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "xxxxxx" Line: 19"] Source File: xxxxxxxxx Line: 19 I am passing URL paramter as http://www.xyz.com/myscriptfolder/myfile.js . The $.ajax method works well when i have the url in the broswer as http://www.xyz.com but it won't work when I have th url in browser like http://xyz.com Could you suggest me any workaround for

How do I call a particular class method using ScriptManager

谁都会走 提交于 2019-12-13 03:26:29
问题 I've created a particular server control that has some methods I'd like to call from javascript. I know that the ScriptManager allows to call a web service or a page method. But I'd like to call a particular class method (I can do this with Anthem or even AjaxPro.NET). Is there a way to accomplish this using ScriptManager? Thanks. 回答1: The class needs to be exposed as a web service. Then you can use JSON to access it client side For example: (In an ASMX file such as Address.asmx)

LinkButton postback problem inside custom WebControl

流过昼夜 提交于 2019-12-13 03:24:59
问题 I've given up trying to find a solution to this. My page has a ModalPopupExtender that shows an asp:Panel with my custom WebControl inside it. My custom WebControl contains only a LinkButton and is inside an UpdatePanel. The problem is that, when clicked, the LinkButton it is reloading the entire page. With a regular input Button, this does not happen. The LinkButton refuses to work as expected and reloads the entire page :( If I use the LinkButton alone inside the UpdatePanel (not inside my

Disable dates conditionally with Asp.net Ajax Calendar Extender

蓝咒 提交于 2019-12-13 03:22:31
问题 If you have used Calendar Extender, i am looking for ways to disable dates based on selection from another calendar selected date. In a project management application there are end and start dates, i am looking for ways to validate these on client. Someways would require postback which i am not willing to perform. There seems to be StartDate and EndDate properties for the calendar on the server, but does not seem to have any client side counterparts. Have you got any ideas how i can perform

Page.ClientScript Register a pair of javascript code

时光怂恿深爱的人放手 提交于 2019-12-13 02:44:31
问题 How can I register a javascript code a page? I want to put th javascript function to the aspx.page; I thing it might be like that; string strJS= "<script language = javascript> (function(images, elements) { var fetchImages = function() { if(images.length > 0) { var numImages = 10; while(images.length > 0 && numImages-- > 0) { // assuming your elements are <img> document.getElementById(elements.shift()).src = images.shift(); // if not you could also set the background (or backgroundImage) css

Send array via Ajax and bind to List<string> on MVC 4

怎甘沉沦 提交于 2019-12-13 00:41:17
问题 AJAX: function systemsChanged(elem) { var items = []; for (i = 0; i < elem.length; i++) if (elem[i].selected) { items.push(elem[i].value); } var post = { ids: items }; $.ajax({ type: "POST", traditional: true, url: "@Url.Action("LoadApplicationConfigs", "Application")", content: "application/json; charset=utf-8", dataType: "json", data: JSON.stringify(post), success: function (d) { alert(d.message); }, error: function (xhr, textStatus, errorThrown) { alert("não rolo"); } }); } C# MVC 4:

Is there something like too much AJAX ? How do you handle screen resizing due to AJAX?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 00:39:07
问题 Q1: Is there something like too much ajax?? Explanation: I have been seeing programmers using Ajax/jQuery etc where I think its not even required. I had built a reporting tool for the company's senior management ( age group 55+) and had to refactor many pages and actually take out the ajaxy stuff from it. Are these things to be handled in requirements or are we looking at AJAX overkill? Q2: How do you handle screen resizing?? Explanation: I have a page that has multi-level master detail

togglebuttonextender image display issue

余生颓废 提交于 2019-12-12 19:03:47
问题 I am using Ajax ToggleButtonExtender to show check and uncheck images for 2 columns of check boxes. These are in a GridView within a Panel. They display and work fine until the number of rows in the GridView exceeds the size of the Panel, at which time the Panel scrolls, but the ToggleButtonExtender images continue to display below the Panel, and when I scroll the Panel the images stay where they are so do not aline with the other columns in the GridView. Any ideas? Heres my code : <asp:Panel

Ajaxcontrolkit calendar control - customisation

瘦欲@ 提交于 2019-12-12 18:02:48
问题 Can the calendar control be customsised so that, say you have a system of renting out a holiday home. can the dates that have been booked appear as red and disabled on the ajaxcalendar control? Cheers -- Jonesy 回答1: Run forest - run away from the ajax control toolkit. jQuery is your friend. Heres a link to the jquery Ui calendar. Other good plug-ins exists as well as other good javascript libraries, but MS is getting behind jQuery and jQuery UI is the official UI library. http://jqueryui.com