postback

ASP.NET Ajax postback suddenly stops on IPhone/IPad

孤街浪徒 提交于 2019-11-30 04:34:48
问题 I have an Asp.Net 4.0 website/control interface that uses an update panel and some buttons. The update panel is wired to a timer that executes every 5 seconds, causing a partial postback. The buttons toggles some settings and then forces an update of the update panel through a call similar to this: var prm = Sys.WebForms.PageRequestManager.getInstance(); prm._doPostBack('<%= UpdatePanel.ClientID %>', ''); return true; The site runs fine on IE/Firefox and on Safari mobile devices (IPhone/IPad)

jquery needs to rebind events on partial page postback

会有一股神秘感。 提交于 2019-11-30 04:19:19
问题 How can I rebind my events (jquery) when I perform a partial page postback? I am wiring everything up using: $(document).ready(function(){}; After a partial page postback, my events are not firing. 回答1: You can either tap into the PageRequestManager endRequestEvent: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(){}); Or if it is control events you're trying to attach, you can use jQuery live events. Another option is to do the event delegation manually. It is what the

ASP:TextBox Value disappears in postback only when password

China☆狼群 提交于 2019-11-30 02:50:56
问题 I have an asp.net textbox like this: <asp:TextBox ID="PINPad" runat="server" Columns="6" MaxLength="4" CssClass="PINTextClass"></asp:TextBox> It is, as you might have guessed, the text box from an on screen PIN pad. Javascript fills in the values. The page is posted back every five seconds (using an update panel if that matters) to update various other unrelated items on the screen. This works just fine. However, when I convert it to a password text box, like this: <asp:TextBox ID="PINPad"

JavaScript: Multiple parameters in __doPostBack

南楼画角 提交于 2019-11-30 01:34:43
问题 First of all, the only post (calling-multiple-dopostback-from-javascript) I found about this didn't help my problem, so I don't belive this post is a duplicate. I have this JavaScript function in my ASPX webpage that includes a __doPostBack function: function OpenSubTable(bolID, controlID) { // code __doPostBack('UpdatePanelSearch', bolID); // more code } Works perfectly and I can get the value of bolID into my code behind like this: protected void UpdatePanelSearch_Load(object sender,

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

余生长醉 提交于 2019-11-30 00:45:18
问题 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

change cursor to busy while page is loading

邮差的信 提交于 2019-11-29 19:06:53
问题 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

Asp.net “Global” variables

十年热恋 提交于 2019-11-29 15:48:35
I'm writing a page in ASP.NET and am having problems following the cycle of initialization on postbacks: I have (something akin to) the following: public partial class MyClass : System.Web.UI.Page { String myString = "default"; protected void Page_Init(object o, EventArgs e) { myString = Request["passedString"]; //note that I've tried to set the default here in Init on NULL... } protected void Page_Load(object o, EventArgs e) { if(!Postback) { //code that uses myString.... } else { //more code that uses myString.... } } } And what's happening is that my code picks up the "passedString" just

Keeping Data in GridView after PostBack

蹲街弑〆低调 提交于 2019-11-29 15:27:13
I have a GridView which is associated with an SqlDataSource . When I click a Button , I change the SelectCommand and then I use DataBind to update the GridView . After PostBack, I want the latest Data to Remain, I don't want the GridView to be loaded by the original SelectCommand . I know this is done by something called ViewState , but I didn't manage to implement it in the right way. I tried both EnableViewState="true" and EnableViewState="false" on the Grid itself, with no luck. Code <asp:GridView ID="GridView1" ...... DataSourceID="UsersSource" > <asp:SqlDataSource ID="UsersSource" ...

aspnet webforms disable button on submit

橙三吉。 提交于 2019-11-29 15:16:07
I have a small problem in Webforms. I'm trying to disable the submit button on submit, to prevent double posts. The problem is, that the onclick method in codebehind is not getting called if the submit button is disabled during postback. Postback still occurs, but the buttons onclick method doesn't get called. Is there a way to get around this? Here a small demo of the problem: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="WebApplication2._default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script

How can I create buttons and hook up events from postback

泪湿孤枕 提交于 2019-11-29 14:41:11
问题 I need to generate buttons initially based on quite a processor and disk intensive search. Each button will represent a selection and trigger a postback. My issue is that the postback does not trigger the command b_Command. I guess because the original buttons have not been re-created. I cannot affort to execute the original search in the postback to re-create the buttons so I would like to generate the required button from the postback info. How and where shoud I be doing this? Should I be