Search Results

Search found 10381 results on 416 pages for 'delegate and events'.

Page 122/416 | < Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >

  • Why does Visual Studio sometimes add a number when creating page events in codebehinds?

    - by Kevin Pang
    When writing up a codebehind in Visual Studio for ASP.NET web forms applications, I often use the dropdowns at the top of the window to autogenerate page event handlers (e.g. Page_Load, Page_PreRender). I've noticed that sometimes Visual Studio likes to add numbers to these function names like "Page_Load1" or "Page_PreRender2". Programatically speaking, this has no effect on the code. But stylistically, I find it a bit ugly. Is there any way to get rid of this behavior?

    Read the article

  • Jquery Ui DatePicker, attaches to textbox but only works once, then all click events are disabled.

    - by RubbleFord
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.7.2.custom.css" type="text/css" media="all" /> <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#date').datepicker(); }); </script> </head> <body> <%--<form id="form1" runat="server">--%> <div> <input type="text" id="date" /> </div> <%--</form>--%> </body> </html> I've attached a datepicker to a text box and the first time I click it, it works a treat and populates the text box with the current date. It works fine in IE7 Comp mode, Chrome and Firefox. It works once or twice on IE8 but locks the browser up after that. One interesting note is the host operating system is Windows 2008 R2. Any ideas?

    Read the article

  • What are the basics of dealing with user input events in Android?

    - by user279112
    Hello. I thought I had understood this question, but something is quite wrong here. When the user (me, so far) tries to press keys, nothing really happens, and I am having a lot of trouble understanding what it is that I've missed. Consider this before I present some code to help clarify my problem: I am using Android's Lunar Lander example to make my first "real" Android program. In that example, of course, there exist a class LunarView, and class nested therein LunarThread. In my code the equivalents of these classes are Graphics and GraphicsThread, respectively. Also I can make sprite animations in 2D just fine on Android. I have a Player class, and let's say GraphicsThread has a Player member referred to as "player". This class has four coordinates - x1, y1, x2, and y2 - and they define a rectangle in which the sprite is to be drawn. I've worked it out so that I can handle that perfectly. Whenever the doDraw(Canvas canvas) method is invoked, it'll just look at the values of those coordinates and draw the sprite accordingly. Now let's say - and this isn't really what I'm trying to do with the program - I'm trying to make the program where all it does is display the Player sprite at one location of the screen UNTIL the FIRST time the user presses the Dpad's left button. Then the location will be changed to another set position on the screen, and the sprite will be drawn at that position for the rest of the program invariably. Also note that the GraphicsThread member in Graphics is called "thread", and that the SurfaceHolder member in GraphicsThread is called "mSurfaceHolder". So consider this method in class Graphics: @Override public boolean onKeyDown(int keyCode, KeyEvent msg) { return thread.keyDownHandler(keyCode, msg); } Also please consider this method in class GraphicsThread: boolean keyDownHandler(int keyCode, KeyEvent msg) { synchronized (mSurfaceHolder) { if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) { player.x1 = 100; player.y1 = 100; player.x2 = 120; player.y2 = 150; } } return true; } Now then assuming that player's coordinates start off as (200, 200, 220, 250), why won't he do anything different when I press Dpad: Left? Thanks!

    Read the article

  • What's the best practice to add default function to jQuery Dialog open/close events?

    - by BlueFox
    Hi All, I'm trying to define some default behaviours for my jQuery Dialogs like the following: (function($) { /** * Overriding default options **/ $.ui.dialog.defaults.bgiframe = true; $.ui.dialog.defaults.open = function() { if ($('.ui-widget-overlay').length == 0) return; if ($.browser.msie) { // scrollbar fix for IE $('html').css('overflow-y','hidden'); $('html').css('overflow-x','hidden'); } else { // disable scrollbar for other browsers $('body').css('overflow','hidden'); } }; $.ui.dialog.defaults.beforeclose = function(event, ui) { if ($('.ui-widget-overlay').length == 0) return; if ($.browser.msie) { // scrollbar fix for IE $('html').css('overflow-y','auto'); $('html').css('overflow-x','auto'); } else { // disable scrollbar for other browsers $('body').css('overflow','auto'); } }; })(jQuery); The above works when I have no custom open/beforeclose function specified when the dialog is created. So I'm wondering what is the best practice to add these functionality into all my dialogs, while preserving the ability to specify open/beforeclose functions.

    Read the article

  • How to handle update events on a ASP.NET GridView?

    - by Bogdan M
    Hello, This may sound silly, but I need to find out how to handle an Update event from a GridView. First of all, I have a DataSet, where there is a typed DataTable with a typed TableAdapter, based on a "select all query", with auto-generated Insert, Update, and Delete methods. Then, in my aspx page, I have an ObjectDataSource related to my typed TableAdapter on Select, Insert, Update and Delete methods. Finnally, I have a GridView bound to this ObjectDataSource, with default Edit, Update and Cancel links. How should I implement the edit functionality? Should I have something like this? protected void GridView_RowEditing(object sender, GridViewEditEventArgs e) { using(MyTableAdapter ta = new MyTableAdapter()) { ta.Update(...); TypedDataTable dt = ta.GetRecords(); this.GridView.DataSource = dt; this.GridView.DataBind(); } } In this scenario, I have the feeling that I update some changes to the DB, then I retrive and bind all the data, and not only the modified parts. Is there any way to update only the DataSet, and this to update on his turn the DataBase and the GridView? I do not want to retrive all the data after a CRUD operations is performed, I just want to retrive the changes made. Thanks. PS: I'm using .NET 3.5 and VS 2008 with SP1.

    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

  • Suppose i have an HTML table. How do I use JQuery events on this?

    - by alex
    <table> <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr> <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr> <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr> <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr> <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr> </table> How do I make the appropriate col1 fill with the letters "ABC" when the user rollovers the row? And then disappear the "ABC" when the user moves the mouse away from that row? So far, I got this. I solved it. $(".ep").hover(function(){ $(this).find('td.playButtonCol').html('PLAY'); },function(){ $(this).find('td.playButtonCol').html(''); });

    Read the article

  • How can I force a jQuery faded-in user control to remain after click events?

    - by David
    I have a basic page to which I'm adding an uploader control based on Bulk Uploader at c-sharpcorner.com and the control is in a jQuery-faded div based on yesdegisn The Bulk Uploader has two server side event handlers for two buttons--Add and Remove. After clicking these buttons, the fade disappears and you're back to the basic page--if the user needs to add more files, this is not desirable. The ArrayList of files added to a ListBox is maintained, but I have to click the "fade-in" link (LinkButton id="lnkDocumentUpload") to display this window again. I also need the control to POST to UploadPost.aspx, and it doesn't work either. Clicking the upload button(<asp:Button ID="btnUpload" runat="server" />) has the same behavior described above--fade disappears, data is retained, and no POST. I've surrounded the control with <form id="frmUpload" action="~/UploadPost.aspx"> ... <asp:Button ID="btnUpload" runat="server" Text="Upload"/> </form> A LinkButton activates the fade in jQuery via $("#lnkDocumentUpload").click(function() { centerPopup(); loadPopup(); });

    Read the article

  • Can threads safely read variables set by VCL events?

    - by Tom1952
    Is it safe for a thread to READ a variable set by a Delphi VCL event? When a user clicks on a VCL TCheckbox, the main thread sets a boolean to the checkbox's Checked state. CheckboxState := CheckBox1.Checked; At any time, a thread reads that variable if CheckBoxState then ... It doesn't matter if the thread "misses" a change to the boolean, because the thread checks the variable in a loop as it does other things. So it will see the state change eventually... Is this safe? Or do I need special code? Is surrounding the read and write of the variable (in the thread and main thread respectively) with critical code calls necessary and sufficient? As I said, it doesn't matter if the thread gets the "wrong" value, but I keep thinking that there might be a low-level problem if one thread tries to read a variable while the main thread is in the middle of writing it, or vice versa. My question is similar to this one: http://stackoverflow.com/questions/1353096/cross-thread-reading-of-a-variable. (Also related to my previous question: http://stackoverflow.com/questions/2449183/using-entercriticalsection-in-thread-to-update-vcl-label)

    Read the article

  • How does Microsoft generate the Event ID for winqual events?

    - by Tim
    I am curious about the IDs that are used to identify items in winqual. I assume it is some sort of hash. Is this published? Hash of the module name, its version and an offset? That seems appropriate but the size is too small to cover the possibilities unless some truncation/lossy algorithm is used. This seems to be generated with the minidump on the client machine.

    Read the article

  • How can I work out what events are being waited for with WinDBG in a kernel debug session

    - by Benj
    I'm a complete WinDbg newbie and I've been trying to debug a WindowsXP problem that a customer has sent me where our software and some third party software prevent windows from logging off. I've reproduced the problem and have verified that only when our software and the customers software are both installed (although not necessarily running at logoff) does the log off problem occur. I've observed that WM_ENDSESSION messages are not reaching the running windows when the user tries to log off and I know that the third party software uses a kernel driver. I've been looking at the processes in WinDbg and I know that csrss.exe would normally send all the windows a WM_ENDSESSION message. When I ran: !process 82356020 6 To look at csrss.exe's stack I can see: WARNING: Frame IP not in any known module. Following frames may be wrong. 00000000 00000000 00000000 00000000 00000000 0x7c90e514 THREAD 8246d998 Cid 0248.02a0 Teb: 7ffd7000 Win32Thread: e1627008 WAIT: (WrUserRequest) UserMode Non-Alertable 8243d9f0 SynchronizationEvent 81fe0390 SynchronizationEvent Not impersonating DeviceMap e1004450 Owning Process 82356020 Image: csrss.exe Attached Process N/A Image: N/A Wait Start TickCount 1813 Ticks: 20748 (0:00:05:24.187) Context Switch Count 3 LargeStack UserTime 00:00:00.000 KernelTime 00:00:00.000 Start Address 0x75b67cdf Stack Init f80bd000 Current f80bc9c8 Base f80bd000 Limit f80ba000 Call 0 Priority 14 BasePriority 13 PriorityDecrement 0 DecrementCount 0 Kernel stack not resident. ChildEBP RetAddr Args to Child f80bc9e0 80500ce6 00000000 8246d998 804f9af2 nt!KiSwapContext+0x2e (FPO: [Uses EBP] [0,0,4]) f80bc9ec 804f9af2 804f986e e1627008 00000000 nt!KiSwapThread+0x46 (FPO: [0,0,0]) f80bca24 bf80a4a3 00000002 82475218 00000001 nt!KeWaitForMultipleObjects+0x284 (FPO: [Non-Fpo]) f80bca5c bf88c0a6 00000001 82475218 00000000 win32k!xxxMsgWaitForMultipleObjects+0xb0 (FPO: [Non-Fpo]) f80bcd30 bf87507d bf9ac0a0 00000001 f80bcd54 win32k!xxxDesktopThread+0x339 (FPO: [Non-Fpo]) f80bcd40 bf8010fd bf9ac0a0 f80bcd64 00bcfff4 win32k!xxxCreateSystemThreads+0x6a (FPO: [Non-Fpo]) f80bcd54 8053d648 00000000 00000022 00000000 win32k!NtUserCallOneParam+0x23 (FPO: [Non-Fpo]) f80bcd54 7c90e514 00000000 00000022 00000000 nt!KiFastCallEntry+0xf8 (FPO: [0,0] TrapFrame @ f80bcd64) This waitForMultipleObjects looks interesting because I'm wondering if csrss.exe is waiting on some event which isn't arriving to allow the logoff. Can anyone tell me how I might find out what event it's waiting for anything else I might do to further investigate the problem?

    Read the article

  • How to populate JList with data from another JList

    - by Zhen Le
    I have a MySQL database which contains data i would like to populate into a JList in my java program. I have two JList, one which is fill with Events Title and the second is to be fill with Guest Name. What i would like is when the user click on any of the Events Title, the second JList will show all the Guest Name that belong to that Event. I have already successfully populate the first JList with all the Events Title. What I'm having trouble with is when the user click on the Events Title, the Guests Name will show twice on the second JList. How can i make it to show only once? Here is what i got so far... Java Class private JList getJListEvents() { if (jListEvents == null) { jListEvents = new JList(); Border border = BorderFactory.createTitledBorder(BorderFactory.createBevelBorder(1, Color.black, Color.black), "Events", TitledBorder.LEFT, TitledBorder.TOP); jListEvents.setBorder(border); jListEvents.setModel(new DefaultListModel()); jListEvents.setBounds(new Rectangle(15, 60, 361, 421)); Events lEvents = new Events(); lEvents.loadEvents(jListEvents); jListEvents.addListSelectionListener(new ListSelectionListener(){ public void valueChanged(ListSelectionEvent e){ EventC eventC = new EventC(); //eventC.MonitorRegDetailsInfo(jListEvents, jTextFieldEventName, jTextFieldEventVenue, jTextFieldEventDate, jTextFieldEventTime, jTextAreaEventDesc); //eventC.MonitorRegPackageInfo(jListEvents, jTextFieldBallroom, jTextFieldBallroomPrice, jTextFieldMeal, jTextFieldMealPrice, jTextFieldEntertainment, jTextFieldEntertainmentPrice); eventC.MonitorRegGuest(jListEvents, jListGuest); } }); } return jListEvents; } Controller Class public void MonitorRegGuest(JList l, JList l2){ String event = l.getSelectedValue().toString(); Events retrieveGuest = new Events(event); retrieveGuest.loadGuests(l2); } Class with all the sql statement public void loadGuests(JList l){ ResultSet rs = null; ResultSet rs2 = null; ResultSet rs3 = null; MySQLController db = new MySQLController(); db.getConnection(); String sqlQuery = "SELECT MemberID FROM event WHERE EventName = '" + EventName + "'"; try { rs = db.readRequest(sqlQuery); while(rs.next()){ MemberID = rs.getString("MemberID"); } } catch (SQLException e) { e.printStackTrace(); } String sqlQuery2 = "SELECT GuestListID FROM guestlist WHERE MemberID = '" + MemberID + "'"; try { rs2 = db.readRequest(sqlQuery2); while(rs2.next()){ GuestListID = rs2.getString("GuestListID"); } } catch (SQLException e) { e.printStackTrace(); } String sqlQuery3 = "SELECT Name FROM guestcontact WHERE GuestListID = '" + GuestListID + "'"; try { rs3 = db.readRequest(sqlQuery3); while(rs3.next()){ ((DefaultListModel)l.getModel()).addElement(rs3.getString("Name")); } } catch (SQLException e) { e.printStackTrace(); } db.terminate(); } Thanks in advance!

    Read the article

  • How best to associate code with events in jQuery?

    - by Ned Batchelder
    Suppose I have a <select> element on my HTML page, and I want to run some Javascript when the selection is changed. I'm using jQuery. I have two ways to associate the code with the element. Method 1: jQuery .change() <select id='the_select'> <option value='opt1'>One</option> <option value='opt2'>Two</option> </select> <script> $('#the_select').change(function() { alert('Changed!'); }); </script> Method 2: onChange attribute <select id='the_select' onchange='selectChanged();'> <option value='opt1'>One</option> <option value='opt2'>Two</option> </select> <script> function selectChanged() { alert('Changed!'); } </script> I understand the different modularity here: for example, method 1 keeps code references out of the HTML, but method 2 doesn't need to mention HTML ids in the code. What I don't understand is: are there operational differences between these two that would make me prefer one over the other? For example, are there edge-case browsers where one of these works and the other doesn't? Is the integration with jQuery better for either? Does the late-binding of the code to the event make a difference in the behavior of the page? Which do you pick and why?

    Read the article

  • How can I receive mouse events when a wrapped control has set capture?

    - by Greg
    My WndProc isn't seeing mouse-up notifications when I click with a modifier key (shift or control) pressed. I see them without the modifier key, and I see mouse-down notifications with the modifier keys. I'm trying to track user actions in a component I didn't write, so I'm using the Windows Forms NativeWindow wrapper (wrapping the component) to get Windows messages from the WndProc() method. I've tried tracking the notifications I do get, and I the only clue I see is WM_CAPTURECHANGED. I've tried calling SetCapture when I receive the WM_LBUTTONDOWN message, but it doesn't help. Without modifier (skipping paint, timer and NCHITTEST messages): WM_PARENTNOTIFY WM_MOUSEACTIVATE WM_MOUSEACTIVATE WM_SETCURSOR WM_LBUTTONDOWN WM_SETCURSOR WM_MOUSEMOVE WM_SETCURSOR WM_LBUTTONUP With modifier (skipping paint, timer and NCHITTEST messages): WM_KEYDOWN WM_PARENTNOTIFY WM_MOUSEACTIVATE WM_MOUSEACTIVATE WM_SETCURSOR WM_LBUTTONDOWN WM_SETCURSOR (repeats) WM_KEYDOWN (repeats) WM_KEYUP If I hold the mouse button down for a long time, I can usually get a WM_LBUTTONUP notification, but it should be possible to make it more responsive.. Edit: I've tried control-clicking outside of the component of interest and moving the cursor into it before releasing the mouse button, and then I do get a WM_LBUTTONUP notification, so it looks like the component is capturing the mouse on mouse-down. Is there any way to receive that notification when another window has captured the mouse? Thanks.

    Read the article

  • How to disable firefox's form auto completion without change events?

    - by Dmitriy Likhten
    So firefox has a nifty mechanism which will try to autocomplete values in fields when a page is reloaded or the back button is used. Which is great and all except when you have something like a drop-down which when set to a value modifies the page using ajax. What winds up happening is that the browser reloads the page, the drop down is pre-filled with the remembered value, and then no change event is fired when the dom is ready. And therefore the change handlers attached don't fire and thus the page does not update. Is there a good way to "fix" this behavior so that it works for the user as expected: a) We do want the browser to auto-complete because that is a good user experience. b) Still want that onchange event firing. The only thing I can think of doing at the moment is to add an on-ready event to the document which has javascript pre-populated with initial values in the form, when the document loads the javascript will check the pre-populated values and if not matching what is in the input will trigger the change handlers. Anyone have a better solution? Is there a lib that does this already? (Using Rails 2.3.5 + jQuery)

    Read the article

  • In Windows 7, clicking between file explorer windows does not generate window events. What's up?

    - by asmw
    I have a custom made global hook installed and am monitoring for window messages when file explorer windows are clicked on. The funny thing is that they don't generate any window messages! I click between two file explorer windows and nothing. No VM_CREATE, no VM_ACTIVATE. Nothing. Why is this? Spy++ crashes on my machine so I can't use it but my hook is pretty good and should pick everything up. For some reason these windows just don't function like normal windows in that they don't generate the standard window messages when they become active. It seems windows 7 does not see them as normal windows? what's going on?

    Read the article

  • Bing Map on Windows Phone - add click events to pushpins; display more details

    - by Will Gill
    I have a WP Phone app using a Bing Map control. I have an array of objects, and each object has a location. I iterate the array to place the pins on the map (see below). I have a touch event bound to each pin to allow the user to tap the pin to start an action. Now - I would like, on tap, to show information from the object that relates to that pin to be shown in a textbox. How can I retrieve the object from the array that corresponds to the pushpin that was tapped/clicked? foreach (wikiResult result in arrayResults) { double lat = double.Parse(result.Latitude, CultureInfo.InvariantCulture); double lng = double.Parse(result.Longitude, CultureInfo.InvariantCulture); statusTextBlock.Text = result.Latitude + " " + result.Longitude + " " + lat + " " + lng; GeoCoordinate d = new GeoCoordinate(lat, lng); Pushpin pin; pin = new Pushpin(); pin.Location = d; pin.Content = result.Name; pin.MouseLeftButtonUp += new MouseButtonEventHandler(pin1_MouseLeftButtonUp); myMap.Children.Add(pin); } void pin1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { //display the content from the object in a text box } Many thanks in advance!

    Read the article

  • Does/Will autofac's ASP.NET integration support PreInit or Init events?

    - by David Rubin
    I see from poking around in the 1.4.4 source that Autofac's ASP.NET integration (via Autofac.Integration.Web) peforms injection of properties on the Page as part of the HttpContext.PreRequestHandlerExecute event handling, but that the page's child controls don't get their properties injected until Page.PreLoad. What this means, though is that the injected properties of child controls are unavailable for use in the OnInit event handler. For example, this works fine: HelloWorld.aspx: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HelloWorld.aspx.cs" Inherits="HelloWorld" %> <html> <body> <asp:Label runat="server" id="lblMsg" OnInit="HandleInit"/> </body> </html> HelloWorld.aspx.cs: ... protected void HandleInit() { lblMsg.Text = _msgProvider.GetMessage(); } public IMsgProvider _msgProvider { private get; set; } // <-- Injected But changing the HelloWorld Page to a UserControl (.acsx) and putting the UserControl in another page doesn't work because _msgProvider isn't injected early enough. Is there a way to make Autofac inject properties of child controls earlier? Or is this something that can be addressed in a future build? Thanks!

    Read the article

  • Actionscript Receiving Mouse Events For Lower Indexed And Partially Covered Display Objects?

    - by Chunk1978
    i have 2 sprites on stage. bottomSprite is added to the display list first, followed by topSprite. topSprite partially covers bottomSprite. i've added an event listener to bottomSprite for MouseEvent.MOUSE_MOVED notifications to simply trace the mouseX and mouseY coordinates. however, the notification doesn't work for the parts of bottomSprite that are covered by topSprite. var bottomSprite:Sprite = new Sprite(); bottomSprite.graphics.beginFill(0x666666, 0.5); bottomSprite.graphics.drawRect(150,150, 150, 150); bottomSprite.graphics.endFill(); addChild(bottomSprite); var topSprite:Sprite = new Sprite(); topSprite.graphics.beginFill(0x00FFFF, 0.5); topSprite.graphics.drawRect(250,50, 150, 150); topSprite.graphics.endFill(); addChild(topSprite); bottomSprite.addEventListener(MouseEvent.MOUSE_MOVE, traceCoords); function traceCoords(evt:MouseEvent):void { trace ("Coord = X:" + bottomSprite.mouseX + ", Y:" + bottomSprite.mouseY); }

    Read the article

  • Control within another control in asp.net disables server-side events?

    - by Xaisoft
    I have a control which has a button on it. All the button does is redirect the user to another page. On this control I have another control which just display some stuff, nothing fancy. When I click on the button, it does nothing. When I remove or comment out the other control, the button event works. Is this by design? I am not sure how to fix it or what is causing it. ControlA.ascx contains a button with an event like so: protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("~/Home.aspx"); } ControlA.ascx contains another control inside of it, lets call it ControlB.ascx. The Button1 click event does not fire when ControlB.ascx is in ControlA.ascx, but when I remove it or take it out, Button1 event fires and it goes to Home.aspx. This does not only happen for Button1, if I decide to add a second button and create an event for it, if ControlB is in ControlA, the second button event won't fire either.

    Read the article

  • Ruby/Rails - Add records to an object with each loop iteration / Object vs Arrays

    - by ChrisWesAllen
    I'm trying to figure out how to add records to an existing object for each iteration of a loop. I'm having a hard time discovering the difference between an object and an array. I have this @events = Event.find(1) @loops = Choices.find(:all, :limit => 5) #so loop for 5 instances of choice model for loop in @loops @events = Event.find(:all,:conditions => ["event.id = ?", loop.event_id ]) end I'm trying to add a new events to the existing @events object based on the id of whatever the loop variable is. But the ( = ) operator just creates a new instance of the @events object. I tried ( += ) and ( << ) as operators but got the error "You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil" I tried created an array events = [] events << Event.find(1) @loops = Choices.find(:all, :limit => 5) #so loop for 5 instances of choice model for loop in @loops events << Event.find(:all,:conditions => ["event.id = ?", loop.event_id ]) end But I dont know how to call that arrays attributes within the view With objects I was able do create a loop within the view and call all the attributes of that object as well... <table> <% for event in @events %> <tr> <td><%= link_to event.title, event %></td> <td><%= event.start_date %></td> <td><%= event.price %></td> </tr> <% end %> </table> How could i do this with an array set? So the questions are 1) Whats the difference between arrays and objects? 2) Is there a way to add into the existing object for each iteration? 3) If I use an array, is there a way to call the attributes for each array record within the view?

    Read the article

< Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >