postback

Disable postback at click on a button

不羁岁月 提交于 2019-11-30 17:36:57
I want do disable postback after clicking a <asp:Button> . I've tried to do that by assigning onclick="return false" , but in the button doesn't work. How can I fix this? onClientClick="return false" That should do it! Onclick will refer to an ASP.net function, onClientClick will render as OnClick on the control in HTML. onclick is used to wire up your server side events. You need to use the OnClientClick handler such as <asp:button OnClientClick="return false;" /> Seeing as none of these answers helped me. I found a solution. Instead of using the ASP.NET button <asp:Button> , you should use

jQueryUI Dialog + Firefox + ASP.Net = access to strict mode caller function is censored

浪尽此生 提交于 2019-11-30 17:13:47
I have a page that works great in IE and Chrome, but doesn't work in Firefox and Opera. When I say it doesn't work I mean that the Submit button doesn't do anything at all. It is a page with several nested UpdatePanels on it and a couple of jQueryUI Accordions on it too. I have a simple div . <div id="date-dialog" title="Date?"> <label id="lblDate" for="txtDate"> Please Enter Your The Date: </label> <input type="text" id="txtDate" class="text ui-widget-content ui-corner-all" /> </div> And then I have some simple code to turn it into a dialog: $('#date-dialog').dialog({ autoOpen: false, modal:

change cursor to busy while page is loading

我只是一个虾纸丫 提交于 2019-11-30 13:46:10
I understand how to use javascript to change the cursor to busy while the page is making and ajax call. However I have a page that does not use ajax, it uses a postback to reload the page. However the load is rather data intensive and it takes a few seconds. During this time the user can still click on the page. I want to turn the cursor to "waiting" so the user does not try to click on the page. For example I have a couple of dropdowns that cause postback. I make a selection and the page loads for 3 seconds. While it loads I would like the cursor to turn to waiting so the user does not try to

asp.net webforms and jquery: How to save/restore jquery state between postbacks?

萝らか妹 提交于 2019-11-30 12:23:09
问题 I am building a asp.net webforms (3.5 sp1) application, using jquery where I can to animate the UI, change its state. It has worked great until I started doing postbacks, where the UI obviously resets itself to its initial state. So my question is, what are the best practices for saving and restoring jquery/UI state between postbacks? Thanks, Egil. Update: Thanks a lot guys, great input, to bad I cant mark more than one answer as the "answer". 回答1: I typically store things like menu state or

How to maintain scroll position on autopostback?

安稳与你 提交于 2019-11-30 11:02:48
How can I get back to the same position of a page on postback . It always seems to get to the top of the page. I've tried using maintainScrollPositionOnPostBack = "true" But its not working. I've recently looked for this as well. Came up with a load of Javascript to be inserted until I found the following: At the top of your .aspx codefile, insert the following: MaintainScrollPositionOnPostback="true" so the very first sentence in your .aspx starts <%@ Page Language="C#" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeBehind="Default.aspx.cs" This works just fine for me

ImageButton does not fire a post back on IE10

假如想象 提交于 2019-11-30 10:00:56
Recently, we tested our products on IE10 and encountered a problem about that server button control “Asp:ImageButton” are not be fired on IE10 with UpdatePanel. And the below is the sample code: <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> Here is the content. </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="buttonSubmit" /> </Triggers> </asp:UpdatePanel> <br /> <br /> <asp:Button ID="buttonSubmit" runat="server" ToolTip="Submit" OnClick=

@ViewScoped Managed bean loads many times during postback

浪尽此生 提交于 2019-11-30 09:33:40
I have a calendar, editor, fileUpload and a dataTable primefaces controls on a jsf facelet. Code is as follows, <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" template="./../templates/masterlayout.xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:f="http://java.sun.com/jsf/core"> <ui:define name="title">#{lbl.SSTitle}</ui:define> <ui:define name="content"> <h:form> <p

Staying on current jQuery tab across post back?

亡梦爱人 提交于 2019-11-30 08:09:56
I am using jQuery tabs and an ASP.NET listview to display and edit some information. My problem is that when a user inserts a new record in one of the listview items my jQuery tabs go back to the first tab. Is there a way to keep track of which tab I am on or keep it from resting on post back? Lloyd Powell In ASP.NET, you can store it in a hidden field without having to use a cookie (no need for the jQuery cookie reference). Use this: $(function () { $("#tabs").tabs({ activate: function() { var selectedTab = $('#tabs').tabs('option', 'active'); $("#<%= hdnSelectedTab.ClientID %>").val

ASP.net Postback - Scroll to Specific Position

*爱你&永不变心* 提交于 2019-11-30 08:02:49
I have an ASP.net WebForms page that has a lot of content on the top of the screen. It has a link button that will post back to the page and show another section of the page. When the page refreshes, I would like to set focus and scroll down to this section of the page. I tried doing txtField.Focus() in my code behind and it will set focus and try to scroll there, but then scrolls right back to the top. The focus is still on my text box but the position of the screen is at the very top. The Link is at the top of the screen which is causing the postback. I want to scroll to the very bottom of

DatePicker disappears after postback

橙三吉。 提交于 2019-11-30 07:18:23
I have an asp:TextBox associated to a jquery DatePicker. This input has a onTextChangedEvent that updates a Literal Control. All this code is inside an UpdatePanel so the Literal Control changes but the page doesn't refresh. The problem I'm facing is that when the event fires, the image that displays the DatePicker disappears. Here's a piece of my code: <asp:UpdatePanel ID="UpdatePanel" runat="server"> <ContentTemplate> <asp:TextBox runat="server" OnTextChanged="EditFromDate_TextChanged" AutoPostBack="true"></asp:TextBox> </ContentTemplate> </asp:UpdatePanel> Then I have: $(document).ready