Search Results

Search found 801 results on 33 pages for 'lifecycle'.

Page 6/33 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Alarm not working if application gets killed

    - by Tobia Loschiavo
    Hi, I am trying to use an alarm to set my widget layout after some minutes. Everything works correctly in normal situation but, if I try to delete the process of my application, simulating a system kill, after the alarm is set, then no alarm is executed. Why? From documentation it seems that alarms are executed by AlarmManager service...so it should work. Thanks Tobia Loschiavo

    Read the article

  • ASP.NET- forcing child/container events to fire before parent onload?

    - by Hans Gruber
    I'm working on a questionnaire type application in which questions are stored in a database. Therefore, I create my controls dynamically on every Page.OnLoad. This works like a charm and ViewState is persisted between postbacks because I ensure that my dynamic controls always have the same generated Control.ID. In addition to the user control that dynamically populates the questions, my questionnaire page also contains a 'Status' section (also encapsulated by a user control) which represents the status of the questionnaire (choices are 'Complete', 'Started' or 'In Progress'). If the user changes the status of questionnaire (i.e. from 'In Progress' to 'Complete'), I need to postback to the server because the contents of the dynamic portion of the questionnaire depend on the selected status. Some questions are always present regardless of status, and yet others may not be present at all for the selected status. The point is, when the status changes, I have to postback to the page and render the right set of questions. Additionally, I need to preserve any user entered values for those questions which are 'always available'. However, due to the page life cycle in ASP.NET, the 'Status' user control's OnLoad, which contains the correct status needed to load the right questions from the DB, doesn't get executed until after the 'dynamic questions' user control has already been populated (with the wrong/stale values). To get around this, I raise an event from my 'Status' user control to the main page to indicate that the Status has changed. The main page then raises an event on the 'dynamic questions' user control. Since by the time this event bubbles up, the 'dynamic questions' user control has already loaded the 'wrong' questions from the DB, it first calls Controls.Clear. It then happily uses the new status to query the database for the 'correct' questions and does a Control.Add() on each. FYI, Control.IDs are consistent across postbacks. This solution works...sorta. The correct set of questions for the selected status do get rendered; however ViewState is getting lost for those 'always available' questions. I'm guessing this is because the 'dynamic questions' user control calls Controls.Clear when responding to the status changed event. This must somehow kill the association between ViewState and my dynamic controls, even though the Control.ID are consistent. This seems like such a common requirement, I'm virtually certain there is a better, cleaner and less error prone approach to accomplish this. In case its not plain obvious, I haven't been able to grok the ASP.NET page life-cycle despite working with it for the last year. Any help is much appreciated!

    Read the article

  • AsyncTask and onDestroy...

    - by stormin986
    I have an activity initiate a few AsyncTask downloads. After two of the three finish, it issues an Intent to load the next activity while still finishing up the last download. Obviously in onDestroy() i will call cancel() on all AsyncTask objects. If the OS tries to destroy my activity after the next activity starts, it will call and begin executing onDestroy in the apps UI thread, right? It won't wait for that AsyncTask to complete, correct? In all cases it will ultimately call onDestroy(), in turn canceling all AsyncTasks?

    Read the article

  • Dynamically adding controls from an Event after Page_Init

    - by GenericTypeTea
    Might seem like a daft title as you shouldn't add dynamic controls after Page_Init if you want to maintain ViewState, but I couldn't think of a better way of explaining the problem. I have a class similar to the following: public class WebCustomForm : WebControl, IScriptControl { internal CustomRender Content { get { object content = this.Page.Session[this.SESSION_CONTENT_TRACKER]; return content as CustomRender; } private set { this.Page.Session[this.SESSION_CONTENT_TRACKER] = value; } } } CustomRender is an abstract class that implements ITemplate that I use to self-contain a CustomForms module I'm in the middle of writing. On the Page_Init of the page that holds the WebCustomForm, I Initialise the control by passing the relevant Ids to it. Then on the overridden OnInit method of the WebCustomForm I call the Instantiate the CustomRender control that's currently active: if (this.Content != null) { this.Content.InstantiateIn(this); } The problem is that my CustomRender controls need the ability to change the CustomRender control of the WebCustomForm. But when the events that fire on the CustomRender fire, the Page_Init event has obviously already gone off. So, my question is, how can I change the content of the WebCustomForm from a dynamically added control within it? The way I see it, I have two options: I separate the CustomRender controls out into their own stand alone control and basically have an aspx page per control and handle the events myself on the page (although I was hoping to just make a control I drop on the page and forget about) I don't use events and just keep requesting the current page, but with different Request Parameters Or I go back to the drawing board with any better suggetions anyone can give me.

    Read the article

  • Display Ajax Loader while page rendering

    - by Dean
    This is probably a simple question but how can I best use an AJAX loader in ASP.NET to provide a loading dialog whilst the page is being built? I currently have an UpdatePanel with an associated UpdateProgressPanel which contains the loading message and gif in a ProgressTemplate. Currently I have a page that onLoad() goes and gets the business entities and then displays them. While it is doing this I would like to display an AJAX loader. Would it be better to have nothing in the page load and have a hidden button that is triggered onLoadComplete or unLoad() which would then wait for the button click method to complete displaying the UpdateProgressPanel?

    Read the article

  • Feature Driven Development Model (SDLC)

    - by j-t-s
    Hi All I've been searching all over the internet for days. Does anybody have, or know of, and can share sample Feature Driven Development documents? I keep coming across gazillions of "samples" with absolutely no useful information whatsoever. Thank you jt

    Read the article

  • When to override OnError?

    - by Ek0nomik
    I'm looking into re-working and simplifying our error handling in an application I support. We currently have all of our pages inheriting from a base class we created, which in turn obviously inherits from System.Web.UI.Page. Within this base class, the OnError method is currently being overridden, and in turn calling MyBase.OnError, and then calling one of our custom logging methods. I don't see any benefit of overriding the OnError method, and I think it would be better to let the Application_Error method in the Global.asax take care of the unhandled exception (logging it) and then the customErrors section in the config would trigger a process to redirect the user. Looking online it looks like people override this method quite frequently, but I don't see a need to and this article from MSDN makes me think the same.

    Read the article

  • asp.net page life-cycle question

    - by Varyanica
    I have a Table and a Button. Table's cells have controls LiteralControl and CheckBox. I check some fields and then by click on button i remove these fields from database. On event Page_PreRender i clear Table and then fill it with updated data. Then it shows me Table with updated data. But if i check fields of table again and do a click on a button it wont do what i expected. In Page_Load event i see that it dont save properties of controls. Checked CheckBox controls appears as unchecked.

    Read the article

  • Better way to kill a Form after the FormClosing event is overridden to hide rather than close?

    - by Paul Sasik
    I have a simple Windows Form that hosts property controls at runtime. To keep the window and its contents alive rather than killing it by handling the FormClosing event, cancel the event and simply hide the form. That's fine but at close of the application I need to actually close the window. I implemented the below but it feels kludgey. Is there a simpler, more clever way to handle this situation? (The form's controller calls KillForm explicitly after it receives a closing event from the main window.) Friend Class HostForm Private _hideInsteadOfClosing As Boolean = True Private Sub HostForm_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) _ Handles Me.FormClosing If _hideInsteadOfClosing Then Me.Hide() e.Cancel = True End If End Sub Public Sub KillForm() _hideInsteadOfClosing = False Me.Close() End Sub End Class

    Read the article

  • remote class alias in air

    - by viv
    Hi in Flex one can easily define the remote class alias like the following: package samples.portfolio { [RemoteClass(alias="flex.samples.marketdata.Stock")] [Bindable] public class Stock { public var symbol:String; public var name:String; public var low:Number; } } But my question is how do you do it in AIR since the client app does not know about the server file structure. Regards,

    Read the article

  • ASP.NET Application Level vs. Session Level and Global.asax...confused

    - by contactmatt
    The following text is from the book I'm reading, 'MCTS Self-Paced Training Kit (Exam 70-515) Web Applications Development with ASP.NET 4". It gives the rundown of the Application Life Cycle. A user first makes a request for a page in your site. The request is routed to the processing pipeline, which forwards it to the ASP.NET runtime. The ASP.NET runtime creates an instance of the ApplicationManager class; this class instance represents the .NET framework domain that will be used to execute requests for your application. An application domain isolates global variables from other applications and allows each application to load and unload separately, as required. After the application domain has been created, an instance of the HostingEnvironment class is created. This class provides access to items inside the hosting environment, such as directory folders. ASP.NET creates instances of the core objects that will be used to process the request. This includes HttpContext, HttpRequest, and HttpResponse objects. ASP.NET creates an instance of the HttpApplication class (or an instance is reused). This class is also the base class for a site’s Global.asax file. You can use this class to trap events that happen when your application starts or stops. When ASP.NET creates an instance of HttpApplication, it also creates the modules configured for the application, such as the SessionStateModule. Finally, ASP.NET processes request through the HttpApplication pipleline. This pipeline also includes a set of events for validating requests, mapping URLs, accessing the cache, and more. The book then demonstrated an example of using the Global.asax file: <script runat="server"> void Application_Start(object sender, EventArgs e) { Application["UsersOnline"] = 0; } void Session_Start(object sender, EventArgs e) { Application.Lock(); Application["UsersOnline"] = (int)Application["UsersOnline"] + 1; Application.UnLock(); } void Session_End(object sender, EventArgs e) { Application.Lock(); Application["UsersOnline"] = (int)Application["UsersOnline"] - 1; Application.UnLock(); } </script> When does an application start? Whats the difference between session and application level? I'm rather confused on how this is managed. I thought that Application level classes "sat on top of" an AppDomain object, and the AppDomain contained information specific to that Session for that user. Could someone please explain how IIS manages Applicaiton level classes, and how an HttpApplication class sits under an AppDomain? Anything is appreciated.

    Read the article

  • How to Execute Page_Load() in Page's Base Class?

    - by DaveDev
    I have the following PerformanceFactsheet.aspx.cs page class public partial class PerformanceFactsheet : FactsheetBase { protected void Page_Load(object sender, EventArgs e) { // do stuff with the data extracted in FactsheetBase divPerformance.Controls.Add(this.Data); } } where FactsheetBase is defined as public class FactsheetBase : System.Web.UI.Page { public MyPageData Data { get; set; } protected void Page_Load(object sender, EventArgs e) { // get data that's common to all implementors of FactsheetBase // and store the values in FactsheetBase's properties this.Data = ExtractPageData(Request.QueryString["data"]); } } The problem is that FactsheetBase's Page_Load is not executing. Can anyone tell me what I'm doing wrong? Is there a better way to get the result I'm after? Thanks

    Read the article

  • Need Help with Page Life Cycle(I think it is screwing me up)

    - by chobo2
    Hi I have dragged a empty asp.net table onto my webform. I generate all the rows in the code behind those. Now my table gets filled up and has dropdown lists. When the user hits save I go through all the rows and update the values from the dropdownlist in the db. This works all great. However if 2 columns have each have "Present" then those 2 columns should be not be shown anymore and 2 new columns get put in its place with other dropdown lists. This all works. However you have to refresh the entire page to for the 2 columns that should go away to go away. So what I tried to do is at the end of the button click event. Clear the whole table and then regenerate it. However when I do this then my values are not saved to the database anymore for whatever reason. if (IsPostBack == false) { // check if dummy variables exist in db- If true just generate tables with values in db. If not generate them. } else { // grab the values from the database // generate tables with the values } btn click event { go through all rows in table(foreach loop) update each column in the database with cells in each row. while in foreach loop. //done } So this is how it goes and it works expect(all correct values are saved) the table is just not updated to the user. Does not work if (IsPostBack == false) { // same code as above } // if postback is true do nothing. By the time it gets to the click event it says there is zero rows in the table so nothing happens. btn click event { // same code } Fails also. if (IsPostBack == false) { // same code as above } else { // same code as above but moved into its own method. gernerateTable(); } btn click event { // update all rows // once done clear the Tables rows // call generateTable() } This last one does nothing as for some reason it does not update anything. I don't understand why. So what am I doing wrong with this life cycle something in my process is wrong. The code works just not when I want the table to be updated right away.

    Read the article

  • How can I most accurately calculate the execution time of an ASP.NET page while also displaying it o

    - by henningst
    I want to calculate the execution time of my ASP.NET pages and display it on the page. Currently I'm calculating the execution time using a System.Diagnostics.Stopwatch and then store the value in a log database. The stopwatch is started in OnInit and stopped in OnPreRenderComplete. This seems to be working quite fine, and it's giving a similar execution time as the one shown in the page trace. The problem now is that I'm not able to display the execution time on the page because the stopwatch is stopped too late in the life cycle. What is the best way to do this?

    Read the article

  • Public static variables and Android activity life cycle management

    - by jsstp24n5
    According to the documentation the Android OS can kill the activity at the rear of the backstack. So, say for example I have an app and open the Main Activity (let's call it Activity A). In this public activity class I declare and initialize a public static variable (let's call it "foo"). In Activity A's onCreate() method I then change the value of "foo." From Activity A the user starts another activity within my app called Activity B. Variable "foo" is used in Activity B. Activity B is then paused after the user navigates to some other activities in other apps. Eventually, after a memory shortage occurs, Activity A then Activity B can be killed. After the user navigates back to my app it restarts (actually "recreates") activity B. What happens: 1) Will variable "foo" at this point have the value that was set to it when Activity A's onCreate() method ran? 2) Variable "foo" does not exist? 3) Variable "foo" exists and but is now the initialized value and not the value set in Activity A's onCreate() method?

    Read the article

  • Android - Where to store generated bitmaps?

    - by Josh
    I've got an app which dynamically generates anywhere from 6 to 100 small bitmaps for the user to move around the screen in a given session. I currently generate them in onCreate and store them to the sd card, so that after an orientation change I can grab them out of external storage and display them again. However, this takes time (the loading) and I'd like to keep the bitmap references around between lifecyle changes for quicker access. My question is, is there a better place to store my generated bitmaps? I was thinking about creating a static storage library in my base activity, something that would only need to be reloaded when the app is completely removed from memory (shutdown, other apps need resources, 30 minute restart, etc). Ideally, I'd like the user to be able to back out to the title screen, click a "Resume" button, and in onCreate I just have access to those resident bitmap references instead of having to load them from storage again. For this reason I don't think Activity.onRetainNonConfigurationInstance is what I need. Alternatively, is there a better way to handle multiple generated bitmaps than what I'm doing or the plan I described?

    Read the article

  • Sinatra/Rails: Persisting custom class instances during app lifetime

    - by knoopx
    Can I assert rails/sinatra apps are initialized only once and all requests share the same app instance? or do new requests spawn new app instances? Is it possible to instance custom classes and persist them during app lifetime without using sessions, database storages or third party services? If so, what are the implications from a thread-safeness point of view? I'm trying to figure how to implement a web-based download manager and I'm currently evaluating ruby-based frameworks.

    Read the article

  • Can an ASP.NET user control determine its context or its parent .aspx file

    - by John Galt
    Is it possible for a user control to determine its "context" or its parent .aspx page in some way? Right now I have a user control that is declared on a typical .aspx page as follows: <%@ Register TagPrefix="uc1" TagName="ManageTitle" Src="../UserControls/ManageTitle.ascx" %> The user control currently emits a textbox as follows: <asp:textbox id="txtTitle" runat="server" MaxLength="60" ToolTip="Describe the item with a short pithy title - most important keywords first"/> The page_load for this .ascx file is currently like this: Me.txtTitle.Text = SetPageTitle() While some places in this web app need this (i.e. a textbox where end-user can type a "title"), I have other places where I want to show the "title" information in a "read-only" way. For example, rather than a textbox, I could use a label control or a textbox with Enabled="false" to prevent data entry. I suppose I could clone this small .ascx file and append a suffix to its name like _RO.ascx or something but I am wondering what the best approach would be. In short, can a user control get some sort of "context" from the page that declares it or is there an altogether better way to accomplish this sort of thing? Thank you.

    Read the article

  • What prevents a user from adding controls to an ASP.NET page client side?

    - by Curtis White
    This goes back to my other question which I thought was sufficiently answers but upon reflect am not sure that it was (sorry). Backgrounder: I am generating a form dynamically. I am pulling from the database the controls. I must associate each control with a database ID which is not the user's session id. I do this currently by storing my ID in the ID for the web control with some other stuff to make it unique/clear what I am doing. On the post back, I iterate through all the controls on my web page checking for my special identifier, ie, MyGeneratedTextBox_ID_Unique. This process enables for 2 important steps, identifying the control was one I generated and also getting the ID for this input field. And, all of this works but I'm still concerned about the security of it. I do not see a security issue with showing the actual database ID's in this case, although agree it is not desirable. However, I am concerned of the following possibilities: If a user could add a nefarious control to my collection and use that for a SQL injection attack. More academic, but if a user could somehow store data for fields they do not have access too by changing the id's. I agree this is a "hack" of a way to do it. But my question is, is it a security risk and is there an 'easy' way to do it in a less hack way? I assume that only the controls that are created/instantiated on the page are added to the controls list.. thus all controls must be created server side and thus the security issue is address but just wanted to validate. Thanks again. PS: I could see adding a property for each control and encrypting the viewstate would be a little more secure.

    Read the article

  • How can I find out if the MainActivity is being paused from my Java class?

    - by quinestor
    I am using motion sensor detection in my application. My design is this: a class gets the sensor services references from the main activity and then it implements SensorEventListener. That is, the MainActivity does not listen for sensor event changes: public void onCreate(Bundle savedInstanceState) { // ... code mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); // The following is my java class, it does not extends any android fragment/activty mShakeUtil = new ShakeUtil(mSensorManager,mAccelerometer,this); // ..more code.. } I can't redesign ShakeUtil so it is a fragment nor activity, unfortunately. Now to illustrate the problem consider: MainActivity is on its way to be destroyed/paused. I.e screen rotation ShakeUtil's onSensorChanged(SensorEvent event) gets called in the process.. One of the things that happen inside onSensorChanged is a dialog interaction, which gives the error: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState When the previous happens between MainActivity's onSaveInstanceState and onPause. I know this can be prevented if I successfully detect that MainActivity is being pause in ShakeUtil. How can I detect that MainActivity is being paused or onSaveInstanceState was called from ShakeUtil? Alternatively, how can I avoid this issue without making Shakeutil extend activity? So far I have tried with flag variables but that isn't good enough, I guess these are not atomic operations. I tried using Activity's isChangingConfigurations(), but I get an undocummented "NoSuchMethodFound" error.. I am unregistering the sensors by calling ShakeUtil when onPause in main ACtivity

    Read the article

  • Asp.net Page and control Events

    - by andrewWinn
    I have looked all over the web and I can not find the information I am looking for and I was hoping that someone could give me a hand. Specifically, I am looking for a comprehensive list of what events occur in the page and control life cycles and what is "available" in each event. Like when can I get a dropdownlists selected value, when can i databind, when can I get at values in view state and what not. Can anyone point me to a comprehensive list for both page and control life cycles? Or even provide that information for me? Thanks in advance.

    Read the article

  • Check through Javascript that page is loading something

    - by Lilitu88
    When the browser is loading something on a page you can see it in the status bar that it says "Waiting for..." or "Transfering..." etc. In firebug you can check in the net tab when something is being loaded and see when it stops. That is what I want. Is there a way for me to trigger an event when that happens ? Or to get the status of the page or something ? Any way for me to know when that changes ? I know I can do this easier if I use Ajax, but I can't since the page it's expecting an Excel report. Thanks

    Read the article

  • What are the elements of a team development suite?

    - by mhempey
    For small-to-large teams developing software together, what tools are used to form a comprehensive team development framework? Specifically, I'm looking for a comprehensive list of all the individual functions involved (e.g. source control, bug management, testing tools, project management), not specific product recommendations. I'm also not restricting the list to a particular methodology (e.g. Scrum).

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >