postback

How Do I Post and then redirect to an external URL from ASP.Net?

拜拜、爱过 提交于 2019-12-04 08:51:35
问题 ASP.NET server-side controls postback to their own page. This makes cases where you want to redirect a user to an external page, but need to post to that page for some reason (for authentication, for instance) a pain. An HttpWebRequest works great if you don't want to redirect, and JavaScript is fine in some cases, but can get tricky if you really do need the server-side code to get the data together for the post. So how do you both post to an external URL and redirect the user to the result

using scrapy to scrape asp.net website with javascript buttons and ajax requests

送分小仙女□ 提交于 2019-12-04 08:45:12
问题 I'd been trying to scrape some date from as asp.net website, the start page should be the following one: http://www.e3050.com/Items.aspx?cat=SON First, I want to display 50 item per page (from the select element) Second, I want to paginate through pages. I tried the following code for 50 items per page, but didn't work: start_urls = ["http://www.e3050.com/Items.aspx?cat=SON"] def parse(self, response): requests = [] hxs = HtmlXPathSelector(response) # Check if there's more than 1 page if len

How to force a postback with asp.net and C#

十年热恋 提交于 2019-12-04 06:57:57
I have a demo scheduled with a client and i need a quick and dirty fix for now. I will find a more appropriate work around tomorrow but for the time being i need a way to force a post back, or refresh the page. i tried: Response.Redirect(""); but it brings me to a page that says "Object moved to here". 'here' is a hyperlink that brings me to the page with desired results but i wish to bypass this message. Any ideas. Response.Redirect("default.aspx"); (or whatever the name of the current page is) Response.Redirect() is not the greatest because there is not state. It's a new request. if you want

ASP.Net 4.0 with TinyMCE and XML Encoding re-encodes Content on Postback

匆匆过客 提交于 2019-12-04 06:55:27
i have a ASP.NET 4.0 based CMS, where i use the TinyMCE (3.4) via jQuery to edit one Textbox. In addition to this i have several other textboxes. There is also another DropDown List on the Page, which controls the Contenttype. This Control has AutoPostback enabled and sets the visibility on the textboxes regarding the selectes item. As i want to keep the Postback Validation on i have configured the TinyXML to use xml for the content serialisation (encoding: "xml"). Now i have the problem, when a postback from e.g. the DropDown List occures, the re-encodes the content. Init: "Hallo" 1st

ASP.NET Keep fileupload after postback

心不动则不痛 提交于 2019-12-04 06:19:32
问题 I'm writing an intranet ASP.NET page using VB.NET. I've run into a particularly nasty problem dealing with handling file uploads. I'll do my best to explain the problem, and perhaps someone can help. My problem is almost a duplicate of this one, or this one, except (other than the filename) I don't care about sending the file to the server until the other data has been reviewed. Here's the situation: Joe Q. Dataentry inputs some data into several fields. The first 3 are drop down, and when he

How DropDownList's SelectedIndexChanged() works without PostBack?

我的未来我决定 提交于 2019-12-04 05:45:12
DropDownList's SelectedIndexChanged() Event fills the ListBox on the page. Obviously this posts the page back to the server. Is there any way to make it happen without full postback? protected void ddlTablo_SelectedIndexChanged(object sender, EventArgs e) { List<string> list = new List<string>(); ListBox1.Items.Clear(); var columnNames= from t in typeof(Person).GetProperties() select t.Name; foreach (var item in columnNames) { list.Add(item); } ListBox1.DataSource = list; ListBox.DataBind(); } slfan You could put the DropDownList into an <asp:UpdatePanel> and set AutoPostBack="true" on the

Prevent duplicate postback in ASP.Net (C#)

若如初见. 提交于 2019-12-04 04:56:48
Simple one here... is there a clean way of preventing a user from double-clicking a button in a web form and thus causing duplicate events to fire? If I had a comment form for example and the user types in "this is my comment" and clicks submit, the comment is shown below... however if they double-click, triple-click or just go nuts on the keyboard they can cause multiple versions to be posted. Client-side I could quite easily disable the button onclick - but I prefer server-side solutions to things like this :) Is there a postback timeout per viewstate that can be set for example? Thanks I

drop down not retaining selected value after post back

此生再无相见时 提交于 2019-12-04 04:27:39
问题 I'm using classic asp, I have a drop down list that the user selects and then presses submit. After they press submit the drop down list is going back to the default value instead of what they selected. Is there anyway to keep the state of the drop down between post backs instead of it going back to the default? Can post code sample if needed. Thanks! 回答1: You have to "select it" serverside according to the values that the user has POSTed. <select id="cars"> <option value="volvo" <% if

How come form.reset() doesn't work after postback on this page?

六月ゝ 毕业季﹏ 提交于 2019-12-04 04:16:36
问题 A student in my class brought this to my attention, and I didn't have an explanation for it-- and I couldn't find one after searching. After clicking the submit button, the reset button does not work. It's as if the browser prevents reset if the resource has been requested via post request. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head

Invalid postback or callback argument. Why?

人盡茶涼 提交于 2019-12-04 03:37:10
So I get the exception 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 from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. With the following stack trace [System.ArgumentException: Untrapped Exception: Invalid postback or callback