postback

ASP.NET - Control Events Not Firing Inside Repeater

别说谁变了你拦得住时间么 提交于 2019-12-04 03:11:04
This is a absurdly common issue and having exhausted all of the obvious solutions, I'm hoping SO can offer me some input... I have a UserControl inside a page which contains a repeater housing several controls that cause postback. Trouble is, all of the controls inside of the repeater never hit their event handlers when they postback, but controls outside of the repeater (still in the UC) are correctly handled. I already made sure my controls weren't being regenerated due to a missing if(!IsPostBack) and I verified that Request.Form["__EVENTTARGET"] contained the correct control ID in the Page

ASP.NET postbacks lose the hash in the URL

江枫思渺然 提交于 2019-12-04 03:07:32
On an ASP.NET page with a tabstrip, I'm using the hash code in the URL to keep track of what tab I'm on (using the BBQ jQuery plugin ). For example: http://mysite.com/foo/home#tab=budget Unfortunately, I've just realized that there are a couple of places on the page where I'm using an old-fashioned ASP.NET postback to do stuff, and when the postback is complete, the hash is gone: http://mysite.com/foo/home ... so I'm whisked away to a different tab. No good. This is a webforms site (not MVC) using .NET 4.0. As you can see, though, I am using URL routing. Is there a way to tell ASP.NET to keep

How to determine which button caused postback

半城伤御伤魂 提交于 2019-12-04 02:46:38
I have 2 button controls. When I click one i'm trying to determine which one caused a postback in the page load. How to do determine this? Kris Krause What about using CommandName and CommandArgument has shown in this example . This way you can have just one handler. <asp:Button id="Button1" Text="Sort Ascending" CommandName="Sort" CommandArgument="Ascending" OnCommand="CommandBtn_Click" runat="server"/> <asp:Button id="Button2" Text="Sort Descending" CommandName="Sort" CommandArgument="Descending" OnCommand="CommandBtn_Click" runat="server"/> Do you come from a Classic ASP background? When I

ASP.NET PostBack on selecting checkbox of treeview

强颜欢笑 提交于 2019-12-03 21:45:35
问题 I have an asp.net project and working in C#. In my project I have a databound listbox that has checkboxes. When the user clicks on a checkbox it should for an example update a label/textbox. The thing is, it doesnt update the label/textbox until I click on a button that does a postback. How will I Call a postback on the checkbox changed event, since the "OnTreeNodeCheckChanged" event looks like it only fires once the postback has been triggered? Is this even a good idea (to want to call a

OnClick events not working in ASP.NET page

百般思念 提交于 2019-12-03 21:28:58
I am having a aspx page which inherits from a master page. In the master page I have a button that is common for every page in the solution. <div class="btn_general_mid"> <asp:Button ID="btnMainSearch" ValidationGroup="MainSearch" OnClientClick="CheckSearchTextBox()" CausesValidation="true" runat="server" OnClick="btnMainSearch_Click" CssClass="search_btn_submit" Text="Search" /> </div> Here the CheckSearchTextBox() is a javascript function and the btnMainSearch_Click is the event which is handling the code behind part of the button. In a certain page this button click event btnMainSearch

ASP.NET UpdatePanel and Javascript __dopostback

主宰稳场 提交于 2019-12-03 07:46:06
I'm calling a partial postback from javascript like so: function GetPolicyClick() {"__dopostback('UpdatePanel1', 'PostCall')";} It does 1/2 of what I need it to. It does call a partial postback, just for my UpdatePanel. Now the tricky part. I'm trying (somehow) to reference the second argument of __dopostback in my code behind. This does not work: Private Sub UpdatePanel1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles UpdatePanel1.Load Dim MyArg As String = Request("__EVENTARGUMENT") End Sub I just get an empty string. Of course, what I'm trying to do might be completely

Do something javascript before asp.net anypostback

纵饮孤独 提交于 2019-12-03 06:02:07
I wanna do something in javascript before page goes for post back. How to run a javascript function before any asp.net postback? $('form').submit(function () { alert('hello'); }); It doesn't work... :( Emech I find the way, in the asp.net forums and it was a some code in codebehind. Just add this to your Page_Load event handler, changing the javaScript string to what you want to happen. string scriptKey = "OnSubmitScript"; string javaScript = "alert('RegisterOnSubmitStatement fired');"; this.ClientScript.RegisterOnSubmitStatement(this.GetType(), scriptKey, javaScript); If you want to do

ASP.NET on .NET 4 causing IE11 throw _doPostBack is undefined javascript error

↘锁芯ラ 提交于 2019-12-03 03:19:51
Edit: The site is on Windows Server 2003, hence cannot be upgraded to .NET framework 4.5. Our web site is serving ASP.NET ON .NET 4. When using IE 11 the auto postback stopped working with the error "_doPostBack is undefined". It's very likely can be fixed with some modification to the browser definition file, which I don't know how yet. Microsoft suggests feature detection (preferred), or changing the browser definition file. http://msdn.microsoft.com/en-us/library/IE/hh869299%28v=vs.85%29.aspx It looks like feature detection means dropping auto postback all together. Isn't that just like

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

穿精又带淫゛_ 提交于 2019-12-03 01:53:54
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(hxs.select('//span[@id="ctl00_ctl00_ContentPlaceHolder1_ItemListPlaceHolder_lbl_PageSize"]/text()')

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

早过忘川 提交于 2019-12-03 01:04:08
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 from your ASP.NET codebehind code? saalon Here's how I solved this problem today. I started from this