asp.net-ajax

How to pass selected files in Kendo Upload as parameter in ajax request

徘徊边缘 提交于 2019-12-13 08:21:38
问题 After much of struggle im posing this question. Im using a Kendo Upload on a page. Am able to post the selected files on the asyn mode with whe the page has Html.BeginForm. But I'm not able to send file details as HttpPostedFileBase when I use ajax request to send data to the controller. Following is my html <form class="form-horizontal" role="form"> <div class="form-group"> @Html.Label("Complaint Name", new { @class = "col-sm-3 control-label" }) <div class="col-sm-4"> @Html.TextBoxFor( m =>

Can I trigger an Update Panel from a Drop Down list in a User Control

孤者浪人 提交于 2019-12-13 07:26:01
问题 I have a user control in a master page with two drop down lists. When the user selects an item out of either ddl, I want to load a specific user control inside an update panel on the content page. I can't figure out how to get the user control to trigger the update panel. Any suggestions are very much appreciated. Master <%@ Register src="toolbar.ascx" tagname="toolbar" tagprefix="uc1" %> <head id="Head1" runat="server"> </head> <body> <form id="form1" runat="server"> <div> <asp

Asp.NET MVC 4 Ajax Request Cancels on Submit

▼魔方 西西 提交于 2019-12-13 07:25:52
问题 Issue Is with Ajax Request Cancel After i call the ProcessMessage from form submit i am having issue Issue with submitting your page is canceling my ajax request, so I am getting error.. Please help me on this View @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id = "formUpload", enctype = "multipart/form-data" })) { <div> <b>Upload File</b> <input type="file" name="file" /> <input type="submit" value="Upload File" name="btnUpload" onclick="progressStatus();"/><br /> </div>

How to ignore empty values when passing a ViewModel (object) via Ajax to an MVC controller

可紊 提交于 2019-12-13 07:03:55
问题 In the following view I'm passing an Object (ViewModel) to controller. It works fine if user enters all the values in the form. The sample Requested URL with querystring generated via LINQ query is as follows: Request URL:http://localhost:50507/OrdCtrl/OrdAction?OrdYear=2016&OrderNumber=CE123&OrderName=testOrder&hasOrdered=true&_=1489509308855 But if the user skips entering one value in the search form, say, orderName the user gets the expected error: NullReferenceException: Object reference

Finding events to be processed in ASP.NET

倾然丶 夕夏残阳落幕 提交于 2019-12-13 06:30:38
问题 On PostBack, from clicking on an ImageButton, it first hits protected void Page_Load(object sender, EventArgs e) Then it hits protected void ImageButton_Click(object sender, EventArgs e) My problem is that in my Page_Load it refreshes a ListBox before the selected items can be processed by ImageButton_Click. Is there a way to tell what events are yet to be processed, so I can handle them? 回答1: Populate/databind your ListBox within Page_Load only on the first load, not after postback.

How can I display a text box's content when the cursor touches the associated label?

寵の児 提交于 2019-12-13 05:10:11
问题 I have a label and a text box associated with it. I have added some text in the text box which is invisible at first; I want to display the content after the cursor moves on the label. How can I do this? 回答1: This is to handle on mouse move in client side javascript. Use label onmousemove event to trap the event, and set textbox visibility to true. [You can easily write the code for yourself] 回答2: You can use onmouseover and onmouseout event on the label. If you can use a framework like

Custom tooltip on Controls

不问归期 提交于 2019-12-13 04:28:58
问题 I wanted to use a similar tooltip as is displayed when we over the videos on this ASP.NET Ajax site. http://www.asp.net/ajax/videos Which control is this? Is it the animation control? How to use a similar tootlip on my controls? 回答1: It's possibly the Popup Control from the Ajax Control Toolikit, but not necessarily. This is very simple to do with css and javascript using a hidden div element and a mouseover event. There's some sample code you can use here: http://www.willmaster.com/blog/css

Trying to Get Data using Ajax call to Controller method MVC My code Attached

ぐ巨炮叔叔 提交于 2019-12-13 03:46:17
问题 I am calling jquery function on dropdown value change jquery method is , function MyFunction() { alert($('#DDlSurvey').val()); $.ajax({ url: "@Url.Action("GetSelectedQuestion", "ConductSurveyController")", data: { prefix: $('#DDlSurvey').val() }, type: "GET", dataType: "json", success: function (data) { // loadData(data); alert(data) alert("Success"); }, error: function () { alert("Failed! Please try again."); } }); //$('#YourLabelId').val('ReplaceWithThisValue'); } </script> Function I'm

What is the best way to load ASP.Net usercontrols via JSON?

只谈情不闲聊 提交于 2019-12-13 03:42:39
问题 What is the best way to emit an asp.net usercontrol back to the browser based on a JSON request? So far I have a web service which creates the user control and sends it back to the browser. However when I post back the whole page, I get an error about "the state information is invalid for this page and might be corrupted." Considering I'm new to Json, I'm going to guess I'm doing it wrong. What's the best way? Should I just turn off view state validation? 回答1: Answer: turn off view state