asp.net-ajax

How can I pass a value entered in a texbox to a PartialViewResult?

人走茶凉 提交于 2019-12-04 06:41:03
问题 I am creating an MVC app where the user can add items to their cart. They can also make partial payments on certain items so I have a TextBox for them to specify how much they want to pay. I am using an Ajax ActionLink to handle the Update/Add to cart actions so that I can increment the cart count without refreshing the screen using a partial view. My issue is that I can't find a way to pass in or access the value entered in the TextBox to my PartialViewResult function. Here is my Model...

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

こ雲淡風輕ζ 提交于 2019-12-04 06:24:23
问题 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.

jQuery AJAX JSON response returns key “d”

风流意气都作罢 提交于 2019-12-04 05:19:49
When I make a jQuery AJAX JSON request, it responds with a "d" attribute. Why is this? here a good article about it http://encosia.com/2009/06/29/never-worry-about-asp-net-ajaxs-d-again/ “.d” what? If you aren’t familiar with the “.d” I’m referring to, it is simply a security feature that Microsoft added in ASP.NET 3.5’s version of ASP.NET AJAX. By encapsulating the JSON response within a parent object, the framework helps protect against a particularly nasty XSS vulnerability. If you aren’t familiar with the “.d” I’m referring to, it is simply a security feature that Microsoft added in ASP

Why is the form action attribute empty on production server?

丶灬走出姿态 提交于 2019-12-04 04:46:48
问题 After deploying a ASP.NET WebForms application to a production server some of the ajax calls has stopped working for me. After some debugging I found out that the following statement (in the internal client-method WebForm_DoCallback) was causing the problem: xmlRequest.open("POST", action, true); The problem seemed to be that the action-variable was empty so after checking the rendered html I found out that the form-tag rendered on the production server looks like: <form method="post" action=

Horizontal and Vertical Accordion

∥☆過路亽.° 提交于 2019-12-04 04:46:41
问题 I want to create a horizontal and vertical accordion in asp.net. I have use Ajax Toolkit Accordion but cannot change its orientation: ------- ------- ------- created using ajax toolkit ------- ||||| ||||| looking for this ||||| ||||| 回答1: Here is an working example for ASP.NET (C#) (USER CONTROL) <head> <title></title> <link href="/UserControls/Accordion/Css/Accordion.css" rel="Stylesheet" type="text/css" media="all" /> </head> <asp:Table ID="AccordionTable" runat="server" CellPadding="0"

How to get the id of Updatepanel which initiated a postback

徘徊边缘 提交于 2019-12-04 04:45:45
Hi I need to intercept server callback after udate panel async post back and determine which panel initiated the request. The code is pretty simple: Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(InterceptUpdateCallback); function InterceptUpdateCallback(sender, args) { var updatedPanels = args.get_panelsUpdated(); for (idx = 0; idx < updatedPanels.length; idx++) { if (updatedPanels[idx].id == "myUpdatePanel") { StartSmth(); break; } } } And it works when UpdatePanel is not inside another UpdatePanel. But when it is inside another UpdatePanel updatedPanels[idx].id has parent

How to get exception information when calling JSON web service

可紊 提交于 2019-12-04 04:36:49
问题 In .NET 3.5, I had the following code: [WebService(Namespace = "http://kitchenpc.com/schemas/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService] public class KitchenPC : System.Web.Services.WebService { [WebMethod] public LogonResult Logon(string username, string password) { //If username and password are not valid... throw new InvalidUsernameOrPasswordException(); } } When I would call it, if I passed in an invalid username and password, the

how to update a control in another updatepanel?

▼魔方 西西 提交于 2019-12-04 04:14:26
问题 I have three updatepanels in hierarchy: UpdatePanel1--Root UpdatePanelChild1 UpdatePanelChild2 Can I update a control in updatePanel1 on an event of the updatepanel2? 回答1: I'm not a big fan of every updatepanel updating all the time - that seems to undo the locality update panels get you. Another option is to specifically call the .Update() method of the OTHER update panel in your code. For example, suppose you have a button on UppdatePanelChild1 that does some processing and modifies a

Using JQuery UI datepicker inside UpdatePanel [duplicate]

ぐ巨炮叔叔 提交于 2019-12-04 02:38:21
This question already has an answer here: jquery datepicker ms ajax updatepanel doesn't work after post back 9 answers I'm trying to use UpdatePanel control and Jquery UI for date picker. But if date picker control (TextBox) is inside UpdatePanel's ContentTemplate, then date picker does not works. Here is the code: <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script src="Scripts/jqueryui/js/jquery-ui-1.8.8.custom.min.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> $(function () { var dates = $(" #txtDatePicker").datepicker(

Setting active tab in ASP.NET Ajax TabContainer causes entire container to disappear

 ̄綄美尐妖づ 提交于 2019-12-04 01:38:50
问题 I have an ASP.NET page that uses the ASP.NET Ajax Control Toolkit TabContainer. In the Page_Load event, I am hiding some of the tabs based on the data given to the page. I then want to make one of the tabs active based on the value of an (optional) query string parameter. So I have: protected void Page_Load ( object sender, EventArgs e ) { if ( !this.IsPostBack ) { // Tabs with no data are hidden in here LoadDataIntoTabs(); PreselectCorrectTab(); } } private void PreselectCorrectTab () { if (