.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Escape Key Behaviour

Posted By:      Posted Date: October 17, 2010    Points: 0   Category :ASP.Net


One of my users just discovered the following:

If you hit ESC twice when on a page containing an update panel with a control inside, if you click on anything else that does a postback, you'll get a System.ArgumentException: Invalid postback or callback argument.  Event validation is enabled using [...] error.

 I would like to know more about the default behaviour of the ESC key. And might be interested in hooking up to the event to fire something else when that happens.

View Complete Post

More Related Resource Links

active directory exception unusual behaviour


i have a small problem
i want user names from active directory for an auto completer type of service
the method is always throwing an exception 
"searcher.FindAll()' threw an exception of type 'System.DirectoryServices.DirectoryServicesCOMException' System.DirectoryServices.SearchResultCollection 

Escape DLL Hell: Simplify App Deployment with ClickOnce and Registration-Free COM


DLL Hell that results from versioning conflicts is generally not a problem in .NET because components do not require registration, and are either totally isolated to an application or are managed in a well-defined side-by-side way with the help of the Global Assembly Cache. But if you're still using COM, wouldn't it be great if you could deploy your existing COM components using a model similar to the .NET Framework? In Windows XP, you can, and this article explains how.

Dave Templin

MSDN Magazine April 2005

Windows XP: Escape from DLL Hell with Custom Debugging and Instrumentation Tools and Utilities, Part


Building on his article published in the June issue, which demonstrated several ways to get process and DLL-related information from APIs such as PSAPI, NTDLL, and TOOLHELP32, the author presents some unusual ways to get system-oriented info that you can easily integrate in your own toolkit. There are three tools included as samples: LoadLibrarySpy, which monitors an application and detects which DLLs are really loaded; WindowDump, which retrieves the content and a detailed description of any window; and FileUsage, which redirects console-mode applications to tell you which process is using any opened file.

Christophe Nasarre

MSDN Magazine August 2002

Windows XP: Escape from DLL Hell with Custom Debugging and Instrumentation Tools and Utilities


DLL conflict problems can be tough to solve, but a large number of tools are available to help. There are also many Windows APIs that you can use to build custom debugging tools. Three such tools are discussed here and provided as samples. DllSpy lists all the DLLs loaded in the system and the processes that are using them. ProcessSpy enumerates the running processes and exposes the DLLs they are using, and ProcessXP displays the list of concurrent running sessions for Windows XP.

Christophe Nasarre

MSDN Magazine June 2002

the list.aspx bad behaviour


I have two tables : table1 (primary) and table2 with one to many relation .

table 1 has more than 130 000 records , table2 has near to 200 000 records .


when i am trying to list table2 , the table2/list.aspx will build filter depending on the relation.; this operation slows down the page (drop down list with 130 000 record)

 I disabled the filter by using the attribute AutoGenerateFilter = False .


now the problem is that table2/list.aspx?key=value will list all the recoreds in table 2 .


why is the page not using the query that is related to the parmeter passed to it ?


List.aspx (or list.aspx?key=value) will always get all the recorders from the table2  after disabling the key relation filter .

I want my table2/list.aspx?key=value  to query the table2 depending on the passed key which is the expected behaviour .

please advice .













ASP.NET DateTime Conversion strange behaviour



I am working on ASP.NET web application where we are using javascript calendar to accept the date in textboxes. The date format is dd/mm/yyyy. The application is running in US and UK environments.

I am facing issues in US environment while storing the dates so I have added 2 keys in config file viz culture which will be either en-US or en-GB depending on the deployment location and baseCulture which will always be en-GB.

In the code, I have added a condition which checks if culture and baseCulture values are not matching then do the conversion of date in US format.

But I have found that the code converts the date from dd/mm/yyyy to mm/dd/yyyy when the key is baseCulture (en-GB) and it throws FormatException when key is culture (en-US).

I am bit confused by this behaviour. Is this normal? Can any one please explain more about this? Note: I am working on a machine which has en-US as language and culture

<add key="culture" value="en-US" />
<add key="baseCulture" value="en-GB" />
// This line works and converts the date from 26/08/2010 to 08/26/2010
// Here the baseCulture is en-GB.
DateTime dt = DateTime.Parse(txtCurrentDate,baseCulture)

// This line throws FormatException. culture 

Split string using Regex with escape sequences

What is the regex to split a string using the delimiter ';', but not split on '\;' ? Backslash would be my escape character in my split string, so finding '\;' would not split, but '\\;' would split. For example I want a regex that would split the following:     "aaa;bb;cccc\;dd\;eee\\;ff\\;ggg\\\;hhh" into the following string array:     aaa     bb     ccc\;dd\;eee\\     ff\\     ggg\\\;hhh   Thanks!   -Sylvain

How to Prevent the expand/collapse behaviour of my Custom Activity?

  How can I prevent the expand feature of my custom activity with custom designer ? I have custom WF4 activities with Custom designers. These activities are not container activities. I just want to prevent the expand feature of the same; just like Assign activity. I set the Collapsible attribute of teh ActivityDesigner false; but still it is expanding to the next level. Thanks AmbilyIT Analyst

VERY strange behaviour of IE7 and 8!

Today is a day where nothing seems to work out as expected.I'm currently making the HTML and Javascript templates for our new Corporate Page.The thing works as expected in Firefox, Opera, Chrome and IE 6, but not in IE 7 and 8!The "thing" is a menu/submenu written by me in javascript.The way it looks in Firefox etc:The way it looks in IE 7 and 8:There is absolutely no explanation for the strange "rounded" edge on the right and the gradient going over it.The background is a semi-transparent optimized PNG without color profiles which shows up gray in IE 6 and transparent in the other browsers - as expected.On my other developer's computer, it shows up perfectly in both IE 7 and 8.What could possibly create this behaviour?----source:<div class="subMenusContainer"> <div class="subMenu" id="aboutUsMenu"> <a href="/Home/AboutAurora">About AURORA</a> <a href="/Home/AboutErichKrammer">Erich Krammer</a> <a href="/Home/AboutFoundation">AURORA Foundation</a> <a href="/Home/AboutPartners">Partners</a> <a href="/Home/AboutCareers">Careers</a> <a href="/Home/AboutContact">Contacts</a> </div> [snip] <div class="subMenu&q

Behaviour of WPF ComboBox with IsTextSearchEnabled=true and isEditable=true is not quite understanda

Hi, imagine you have a ComboBox with the following entries in the DropDown list: 1, 5, 10, 15 Now follow up this scenario: - open DropDown list - type 13 in the edit field -> 10 is selected in DropDown list - press "Enter" As result DropDown list is closed and 10 is placed in the edit field. How to override this behaviour so that 13 would be not overwritten after pressing "Enter"? Regards Efim

On escape key while editing a treeview node

On hitting escape key while editing a treeview i would like to cancel the editing a would like to show the default name that was previously there. Where should i handle this can any one tell me please..    

Create Behaviour Method not Invoked.

framework: .net 4.0 with VS2010 on Windows XP SP3  I am working on creating a WCF  Behaviour which will act as a authorization filter. When i debug the code the control never hits CreateBehavior method in BehaviorExtensionElement class. not sure on what i'm missing. Any help will be appreiciated.   Thyagaraju Govardhan      

Parent-Child, Unbalanced Hierarchy and unexpected Root behaviour

I have a chart accounts that contains an account key and parent account key (like the AW Enterprise sample). Each account ultimately has either Assets or Liabilities as parent. However, There also some accounts appear in the root because they have less levels then the other accounts. to put in other words: the acounts with exactly four levels, ultimately show up with either assets or liabilities in the root but the members with less then four levels, also appear in the root instead of under Assets or Liabilities. Where am I going wrong? The dimension settings appear to be exactly the same as the AdventureWorks-sample.

BUG: Exceptions propagation behaviour is different if the application is run inside visual studio.

I'm going crazy. I have a simple application: one form, one module. The project is configured to start from sub main. The module contains: Module Module1 Public Sub main() Try Application.Run(New Form1) Catch ex As Exception MessageBox.Show(ex.Message, "Fatal Error") End Try End Sub End Module Form1 contains one button and one event: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Throw New Exception("operation aborted") End Sub End Class I run the application inside visual studio... A new instance of Form1 is shown. I click the button. The exception is propagated to the sub main and the messagebox is shown. RIGHT!... I close visual studio (without recompiling anything) and I run the SAME .exe that was generated before... A new instance of Form1 is shown. I click the button. The exception IS NOT propagated to the main sub and a dialog appears: System.Exception: operation aborted in textexception.Form1.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\Lino Barreca\Documenti\Visual Studio 2008\Projects\textexception\textexception\Form1.vb:riga 4 in System.Windows.Forms.Control.OnClick(EventArgs e) in System.Windows.Forms.Button.OnClick(EventArgs e) in System.Windows.Forms.ButtonBase.OnKeyUp(KeyEventArgs kevent)

class names and namespace behaviour

This is something that I'm not sure if it's a problem or something I have configured wrong. Just thinking on it is making my head hurt!! So here goes. What I'm doing...   1. create a blank VS2010 web project called "MySite" targeted at 4.0 2. create a new class object, calling it "class1.vb" (cause it's so unique!!) 3. change default code to read as such...Namespace MySite Public Class Functions Public Shared Function WhatIsTodaysDate() As String Return Date.Now.ToLongDateString End Function End Class End Namespace 4. create a new webform and drop a label control on it. In the page_load event, I want to set the label to equal the value of Function WhatIsTodaysDate. Simple enough, but now comes the part that escapse me. I can do this...Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Label1.Text = MySite.Functions.WhatIsTodaysDate() End Sub but if I want to shorten my code, and call the function using an "Imports" tag i have to do this...Imports MySite.MySite.Functions Public Class WebForm1 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Label1.Text = WhatIsTodaysDate() End Sub End Class Why is VS asking me to call the namespa

Unexpected focus behaviour when disabling controls

I'm working with WindowsForms using C#, but I think the described control behaviour is language independent... I have a form containing 3 comboboxes A, B and C, which have the taborder A.TabIndex=0, B.TabIndex=1 and C.TabIndex=2. Combobox B is enabled/disabled depending on the content of A.Text in A's Validating event (A.Text = "dis" disables combobox B, A.Text="other" enables combobox B): private void A_Validating(object sender, CancelEventArgs e) {     if (A.Text == "dis") {         B.Enabled = false;     }     else {         B.Enabled = true;     } } The behaviour following then is very strange (executed exactly in the given order): 1.) I'm entering "dis" in combobox A. When pressing the tab key, the Validating event disables combobox B. Expected behaviour:  Focus is moved to combobox C Actual behaviour: Focus stays on combobox A 2.) I'm then entering "other" in combobox A and pressing the tab key. Expected behaviour:  Validating event is called and enables combobox B. Focus should then be on B. Actual behaviour: Validating event is NOT called, therefore B is still disabled. Focus is now on C. 3.) I'm setting the focus on combobox A (using tab key or mouse) and

Strange behaviour of a query using a recursive CTE

Hi, I have a problem with a query. The situation is a bit complicated but I'll try to explain it the best I can. Short story: I have a .NET application that executes a recursive query (using CTE) and then uses a DataReader to read each row's each field one-by-one using the GetValue() method. With specific parameters this query behaves quite fast but with other parameters it can take more than a second to read a row's field (instead of the usual ~0.00001 second). Long story: The database: I have 4 tables with the following columns: 1. Entity table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255)), Description (nvarchar(2,000)). 2. Relation table: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), ParentEntityId (int), ChildEntityId (int), Ordinal (int). 3. Property table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255), Description (nvarchar(2,000)). 4. EntityProperty table with 10,000 rows: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), EntityId (int), PropertyId (int). The Entity table has 100,000 rows, the Relation table has 100,000 rows (each entity has a relation), Property table has 22 rows and the EntityProperty table has 2,010,000 rows (properties with Id from 1 to 20 are assigned to all entities and properties with
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend