event-handling

How to obtain the HttpContext in Event Handler

懵懂的女人 提交于 2019-12-02 00:58:32
I’m trying to obtain the HTTPContext within an Event Handler in a Document Library in MOSS, but all I have is a null value of the HTTPContext.Current, I do the same thing on a List and the HTTPContext is returned. There is a way to obtain the HTTPContext in Document Libraries to access the HTTPContext.Request method? Thanks for your help Here is the code: public class TestContextListItemEventReceiver : SPItemEventReceiver { HttpContext current; static object obj; /// <summary> /// Initializes a new instance of the Microsoft.SharePoint.SPItemEventReceiver class. /// </summary> public

Using Events Delegates in multi tenant web application

馋奶兔 提交于 2019-12-02 00:30:41
I'm developing a multi tenant n-tier web application using asp.net Mvc 5. In my service layer I am defining custom events for every important action and raising these events once these actions are executed. For example Public event EventHandler EntityCreated; Public void Create(Entity item) { Save(item); ...... EntityCreated(this, item); } I intend on hooking up business rules and notifications to these events. The main reason I want to use events is decoupling of the logic and easy plug-ability of more events handlers without modifying my service layer. Question: Does it make sense using

Why does IE add a jQuery attribute for server-side element with mouseover handler?

丶灬走出姿态 提交于 2019-12-01 23:58:12
This isn't a crucial piece of knowledge for me, but I would still like to know what exactly is happening here. This is a .NET 3.5 Web Forms application. One of the pages has 3 server-side inputs with type 'submit'. Each one of these inputs has the following JavaScript handlers assigned to them with jQuery: $('.button').mouseover(function() { $(this).addClass('hoverEffect'); }); $('.button').mouseout(function() { $(this).removeClass('hoverEffect'); }); When I run the following script (yes, this is IE specific) $(document).ready(function() { d = window.open(); d.document.open('text/plain').write

Is there a better way to set an initial position for a JPanel graphic?)

被刻印的时光 ゝ 提交于 2019-12-01 23:37:25
In Chapter 15 of Liang's Intro to Java Programming (7th ed.) , he introduces a program to make a (2-D) ball on a JPanel and enlarge it upon clicking enlarge/shrink buttons. I've modified the program so that it also 1) enlarges/shrinks the ball if the user clicks/option+clicks, 2) allows you to pick the color of the ball by pressing a button, and 3) allows you to move the circle by dragging it with your mouse. The last modification is what was giving me trouble for a while, because I wanted to center the ball at the beginning, but then allow the user to move the ball around with the mouse. The

Dynamic Event Handler not Firing

戏子无情 提交于 2019-12-01 23:17:14
问题 I want to create an amount of controls dynamically based on a number the user enters into a textbox. This part I have working fine, but I also need the dynamically created textboxes to have event handlers of their own, so the user can enter a number into them, and have more controls created. My problem is that the event handler I've setup for these controls to use does not fire. Maybe I'm not understanding the ASP.NET page life cycle correctly, but I am currently having the dynamic controls

C# to VB: Class.Event += (sender, args) => FunctionName(params)

佐手、 提交于 2019-12-01 23:11:14
I'm trying to convert the C# code from this webpage to VB. Everything seems to have converted pretty much fine using an online converter tool, but then I reach the following line: fadeOutAnimation.Completed += (sender, args) => OnFadeOutAnimationCompleted(d, hostGrid, grid); The fadeOutAnimation.Completed event produces an event with the signature (sender, args), and d, hostGrid and grid are variables local to the function containing this mysterious event handler assignment. I think I can see that the instruction on this C# line is telling the code to execute the OnFadeOutAnimationCompleted

Windows MessageBox ignoring WM_CLOSE

守給你的承諾、 提交于 2019-12-01 22:42:15
问题 We've got a legacy C Windows application which pops up a modal window via the MessageBox call when a fatal connection error occurs. Our network engineers may be running many of these applications at once. Occasionally, a network glitch will cause the connections being handled by these applications to fail simultaneously. On Windows 7, selecting the 'Close all windows' function from the taskbar does work, because the modal dialog does not appear to be processing the WM_QUIT message. I

What version of IE doesn't pass the event as argument to listeners?

不打扰是莪最后的温柔 提交于 2019-12-01 22:12:36
问题 As some old versions of IE didn't provide the event as argument to event listeners, we got used to (event||window.event) . In order to decide whether it can still make some sense to have this in a modern library, I tried to look at what versions were concerned but I couldn't find this information. So, what's the most recent version of IE that didn't provide the event as argument ? 回答1: Internet Explorer provides a global object window.event, which references the last event. And before IE9

Getting a DataRow from an ASP.NET GridView

主宰稳场 提交于 2019-12-01 21:14:14
I have an ASP.NET GridView that's bound to an ObjectDataSource (which is bound to a MySQL database). On this grid, I have 2 unbound ButtonField columns that I want to trigger server-side events. Hence I have added an eventhandler method to the GridView 's RowCommand event. In the code of said eventhandler, I need to somehow get hold of the underlying DataRow that was clicked on by the user. However, I can't seem to get this to work; if I use code like the following the selectedRow variable is always null : protected void searchResultsGridView_RowCommand(object sender, GridViewCommandEventArgs

Identify which textbox has fired a text changed event

情到浓时终转凉″ 提交于 2019-12-01 21:06:31
I have a number of text boxes that are dynamically created via code. I would like to be able to assign a generic event handler to all the textboxes for the text changed even and then within the handler determine which text box has fired the event. Code I have is: txtStringProperty.TextChanged += TextBoxValueChanged; private void TextBoxValueChanged(object sender, RoutedEventArgs e) { string propertyName = // I would like the name attribute of the textbox here } Please let me know if you require anymore information. Sjoerd The sender parameter contains which control has fired the event. You can