How to know if ToolStripButton click was fired? - c#

In my Windows Forms project I have a BindingNavigator control in a user control (It is a data-binding scenario). Pressing one of the buttons, First, Previous, Next or Last throws exception, crashing the application entirely. To tackle this I have written following code to handle the exception, in the user control.
protected override void OnLoad(EventArgs e)
{
Application.ThreadException += Application_ThreadException;
base.OnLoad(e);
}
private void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
if (bindingNavigatorMovePreviousItem.Pressed)
{
MessageBox.Show(e.Exception.Message);
bsRestrictions.CancelEdit();
}
}
How do I know if the exception thrown is the result of ToolStripButton click event?
The code above is helpless as Pressed property is false in the method, so the message box will not pop out.
Following is from my Program.cs file
[STAThread]
static void Main()
{
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new AppForm());
}
Experienced developers must have understood that I am trying to solve the well known issue with BindingNavigator. This control simply manages BindingSource component. In scenarios where strongly typed data sets are used, navigating through records throws exception crashing the application.

Just debug your application. If you have an idea where the exception is thrown, put a breakpoint there.
When the exception is thrown, you can go back in the call stack.
In the call stack, you should be able to see where the exception came from.
From the code that you are providing, seems hard to help more.

When you click on BindingNavigator buttons, the exception is not thrown from your code, it's thrown in framework classes, so you cannot set a breakpoint. You need to avoid the exception, or if you want to handle it in Application.ThreadException, you need to check stack trace.
This post answers two questions:
How to avoid exception when clicking on navigation buttons or add/remove/save buttons?
How to know if ToolStripButton was involved in the actions which resulted in throwing an exception?
1 - How to avoid exception when clicking on navigation buttons or add/remove/save buttons?
Disable constraints in the form load. Then in the Save button click, enable them, handle the exceptions (if necessary) and disable them again:
private async void Form1_Load(object sender, EventArgs e)
{
dataSet1.EnforceConstraints = false;
}
private void dataTable1BindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
try
{
dataSet1.EnforceConstraints = true;
}
catch (Exception ex)
{
//process errors if necessary
}
dataSet1.EnforceConstraints = false;
}
Any other option to avoid the exception?
Yes, as another option to avoid the error, you can just remove the default functionalities from buttons; for example select the binding navigator, and in properties find the AddNewItem and select (none) as its value. Then double click on the button to handle its click event and handle it like this:
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
{
try
{
myBindingNavigator.BindingSource.AddNew();
}
catch (Exception)
{
//process the error, for example show a message
}
}
2 - How to know if ToolStripButton was involved in the actions which resulted in throwing an exception?
This exception is not thrown from your code, but thrown in framework classes. Looking into the e.Exception.StackTrace of the exception that you have handled in Application.ThreadException, you see all the necessary details including class names and method names:
at System.Data.DataColumn.CheckNullable(DataRow row)
at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean suppressEnsurePropertyChanged, Int32 position, Boolean fireEvent, Exception& deferredException)
at System.Data.DataTable.InsertRow(DataRow row, Int64 proposedID, Int32 pos, Boolean fireEvent)
at System.Data.DataView.FinishAddNew(Boolean success)
at System.Data.DataRowView.EndEdit()
at System.Windows.Forms.CurrencyManager.EndCurrentEdit()
at System.Windows.Forms.BindingSource.EndEdit()
at System.Windows.Forms.BindingSource.AddNew()
at System.Windows.Forms.BindingNavigator.OnAddNew(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
You can also get the stack frames yourself:
var frames = new StackTrace(e.Exception, true).GetFrames();
And then you can search between the frames, for example by checking:
Where(x => x.GetMethod().DeclaringType == typeof(ToolStripButton))

Related

Erratic InvalidOperationException on datagridview

My Winform app is logging AppDomain.CurrentDomain.UnhandledException and Application.ThreadException at the root level, and I got this exception:
System.InvalidOperationException: Operation is not valid due to the current state of the object. at System.Windows.Forms.DataGridView.DataGridViewDataConnection.ProcessListChanged(ListChangedEventArgs e) at System.Windows.Forms.DataGridView.DataGridViewDataConnection.currencyManager_ListChanged(Object sender, ListChangedEventArgs e) at System.Windows.Forms.CurrencyManager.OnListChanged(ListChangedEventArgs e) at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e) at System.ComponentModel.BindingList1.OnListChanged(ListChangedEventArgs e) at System.ComponentModel.BindingList1.FireListChanged(ListChangedType type, Int32 index) at System.ComponentModel.BindingList1.InsertItem(Int32 index, T item) at System.Collections.ObjectModel.Collection1.Add(T item) at System.ComponentModel.BindingList1.AddNewCore() at System.ComponentModel.BindingList1.System.ComponentModel.IBindingList.AddNew() at System.Windows.Forms.CurrencyManager.AddNew() at System.Windows.Forms.DataGridView.DataGridViewDataConnection.AddNew() at System.Windows.Forms.DataGridView.DataGridViewDataConnection.OnNewRowNeeded() at System.Windows.Forms.DataGridView.OnRowEnter(DataGridViewCell& dataGridViewCell, Int32 columnIndex, Int32 rowIndex, Boolean canCreateNewRow, Boolean validationFailureOccurred) at System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick) at System.Windows.Forms.DataGridView.ProcessDownKeyInternal(Keys keyData, Boolean& moved) at System.Windows.Forms.DataGridView.ProcessEnterKey(Keys keyData) at System.Windows.Forms.DataGridView.ProcessDialogKey(Keys keyData) at System.Windows.Forms.Control.ProcessDialogKey(Keys keyData) at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData) at System.Windows.Forms.Control.PreProcessMessage(Message& msg) at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg) at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
This is the result of ex.ToString(), and it returns no custom code of my app, only internal System.Windows.Forms methods.
The exception is raised time to time on some customer machine, I'm even not able to reproduce it myself.
This smell not good, and my assumption was something when I change the datasource bounding of the datagridview. But in this case I should see at least my class in the exception stack, but here nothing.
Any clue to find the root cause, or to debug that?
Many thanks
If you investigate the stack trace, you'll see the root of the problem: customer is trying to add a new record on the grid, so the event handler tries to add the record to the datasource, which lead to another event handler, which tries to add a record to the binding list, which lead to event currencyManager_listChanged firing up, which fails due to wrong state of the object.
Either you dispose your list or you do not unsubscribe from the events of the disposed control.
I've experienced exactly the same exception, and it occurs after the user deletes multiple rows (multi select enabled), and includes the last row in the selection. The last row is for adding new items. Everything works fine, until the user then goes to edit remaining rows, and the exception occurs.
When the user doesn't include the last/add new item row in the selection, everything works fine after the delete.
I haven't had time to investigate exactly why this behavior occurs, but the work around was to not allow the add new item row to be included when multi-selecting items, which can be detected by the IsNewRow property of DataGridViewRow and then calling ClearSelection() on the DataGridView if this row is in the selection.
private void DataGridView1_SelectionChanged(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dataGridView1.SelectedRows)
{
if (row.IsNewRow)
{
dataGridView1.ClearSelection();
return;
}
}
}

Receive Keyboard Events with Window Messages in a WPF-Window (HwndSource.AddHook)

I have a Window with a TextBox. The cursor is inside the TextBox. If I press a key, then I receive a message in WndProc (for KeyUp and KeyDown). But if I set e.Handled = true in the KeyUp and KeyDown events, then I don't receive any key messages:
public partial class MainWindow : Window
{
public MainWindow()
{
Loaded += MainWindow_Loaded;
}
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
var textBox = new TextBox();
textBox.KeyDown += TextBox_KeyDown;
textBox.KeyUp += TextBox_KeyUp;
Content = textBox;
(PresentationSource.FromVisual(this) as HwndSource).AddHook(WndProc);
}
private void TextBox_KeyDown(object sender, KeyEventArgs e)
{
e.Handled = true;
}
private void TextBox_KeyUp(object sender, KeyEventArgs e)
{
e.Handled = true;
}
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
Debug.WriteLine(msg + " " + wParam);
return IntPtr.Zero;
}
}
Is it possible to receive a PreviewKeyDown/PreviewKeyUp event in WndProc?
There are tons of way to intercept key messages. You don't even need any library for this. Using pure Win32 API is OK but if you want simplicity, try handling the ThreadPreprocessMessage event of ComponentDispatcher:
ComponentDispatcher.ThreadPreprocessMessage += (ref MSG m, ref bool handled) => {
//check if WM_KEYDOWN, print some message to test it
if (m.message == 0x100)
{
System.Diagnostics.Debug.Print("Key down!");
}
};
The event is able to receive any key messages before it is actually sent to your window. So it's what you want in this case if you want to handle raw messages (instead of handling PreviewKeyDown, ...).
The AddHook method allows to add some hook proc for the window but it's really limited in WPF (while the equivalent WndProc protected method of Form in winforms can intercept much more messages).
Try using ManagedWinApi. You can install it with NuGet.
PM> Install-Package ManagedWinapi
For extensive examples of keyboard and other msg interception: http://mwinapi.sourceforge.net/
Another alternative is https://easyhook.github.io/
Both libraries are well documented.

DataGridView keydown event not working in C#

DataGridView keydown event is not working when I am editing text inside a cell.
I am assigning shortcut Alt+S to save the data, it works when cell is not in edit mode, but if it is in edit mode below code is not working
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == (Keys.Alt | Keys.S))
{
//save data
}
}
Whenever a cell is in edit mode, its hosted control is receiving the KeyDown event instead of the parent DataGridView that contains it. That's why your keyboard shortcut is working whenever a cell is not in edit mode (even if it is selected), because your DataGridView control itself receives the KeyDown event. However, when you are in edit mode, the edit control contained by the cell is receiving the event, and nothing happens because it doesn't have your custom handler routine attached to it.
I have spent way too much time tweaking the standard DataGridView control to handle edit commits the way I want it to, and I found that the easiest way to get around this phenomenon is by subclassing the existing DataGridView control and overriding its ProcessCmdKey function. Whatever custom code that you put in here will run whenever a key is pressed on top of the DataGridView, regardless of whether or not it is in edit mode.
For example, you could do something like this:
class MyDataGridView : System.Windows.Forms.DataGridView
{
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
{
MessageBox.Show("Key Press Detected");
if ((keyData == (Keys.Alt | Keys.S)))
{
//Save data
}
return base.ProcessCmdKey(ref msg, keyData);
}
}
Also see related, though somewhat older, article: How to trap keystrokes in controls by using Visual C#
Another way of doing it is by using the EditingControlShowing event to redirect the event handling to a custom event handler as below:
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (e.Control is DataGridViewTextBoxEditingControl tb)
{
tb.KeyDown -= dataGridView1_KeyDown;
tb.KeyDown += dataGridView1_KeyDown;
}
}
//then in your keydown event handler, execute your code
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == (Keys.Alt | Keys.S))
{
//save data
}
}
This is true that EditingControlShowing can help, but not if you wants to catch the Enter key. In that case, one should use the following method:
private void dataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (e.Control is DataGridViewTextBoxEditingControl)
{
DataGridViewTextBoxEditingControl tb = e.Control as DataGridViewTextBoxEditingControl;
tb.KeyDown -= dataGridView_KeyDown;
tb.PreviewKeyDown -= dataGridView_PreviewKeyDown;
tb.KeyDown += dataGridView_KeyDown;
tb.PreviewKeyDown += dataGridView_PreviewKeyDown;
}
}
void dataGridView_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyData == Keys.Enter)
{
<your logic goes here>
}
}
A simpler way I just tried out is as follows:
Set the KeyPreview property of the Form to true.
Instead of catching the KeyDown event on Grid, catch the KeyDown event on Form.
Code as follows:
Private Sub form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
If grd.Focused Then
'Do your work
End If
End Sub
I worked with this
private void grdViewOrderDetail_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
grdViewOrderDetail_KeyDown(null,null);
}
private void grdViewOrderDetail_KeyDown(object sender, KeyEventArgs e)
{
//Code
}
The solution
class MyDataGridView : System.Windows.Forms.DataGridView {
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) {
if ( keyData == Keys.Enter ) {
.
Process Enter Key
.
}
return base.ProcessCmdKey(ref msg, keyData);
}
}
Worked perfectly for me
use PreviewKeyDown event
private void dataGridView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
}

DataGridView binding problem: "Index -1 does not have a value."

I have a datagridview bound to a binding source and a couple buttons on a form. One button adds an item to the binding source, the other removes the currently selected item. There's also an event handler that listens to the CurrentChanged event and updates the Enabled status of the Remove button.
Everything is hunky dory until I go to remove the last item from the datagridview. Then I see a very ugly exception:
at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
at System.Windows.Forms.CurrencyManager.get_Current()
at System.Windows.Forms.DataGridView.DataGridViewDataConnection.OnRowEnter(DataGridViewCellEventArgs e)
at System.Windows.Forms.DataGridView.OnRowEnter(DataGridViewCell& dataGridViewCell, Int32 columnIndex, Int32 rowIndex, Boolean canCreateNewRow, Boolean validationFailureOccurred)
at System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
at System.Windows.Forms.DataGridView.SetAndSelectCurrentCellAddress(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick, Boolean clearSelection, Boolean forceCurrentCellSelection)\r\n at System.Windows.Forms.DataGridView.MakeFirstDisplayedCellCurrentCell(Boolean includeNewRow)
at System.Windows.Forms.DataGridView.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
at System.Windows.Forms.ContainerControl.AssignActiveControlInternal(Control value)
at System.Windows.Forms.ContainerControl.ActivateControlInternal(Control control, Boolean originator)
at System.Windows.Forms.ContainerControl.SetActiveControlInternal(Control value)
at System.Windows.Forms.ContainerControl.SetActiveControl(Control ctl)
at System.Windows.Forms.ContainerControl.set_ActiveControl(Control value)
at System.Windows.Forms.Control.Select(Boolean directed, Boolean forward)
at System.Windows.Forms.Control.SelectNextControl(Control ctl, Boolean forward, Boolean tabStopOnly, Boolean nested, Boolean wrap)
at System.Windows.Forms.Control.SelectNextControlInternal(Control ctl, Boolean forward, Boolean tabStopOnly, Boolean nested, Boolean wrap)
at System.Windows.Forms.Control.SelectNextIfFocused()
at System.Windows.Forms.Control.set_Enabled(Boolean value)
at Bug3324.Form1.HandleBindingSourceCurrentChanged(Object _sender, EventArgs _e) in D:\\Dev\\TempApps\\Bug3324\\Bug3324\\Form1.cs:line 41
at System.Windows.Forms.BindingSource.OnCurrentChanged(EventArgs e)
at System.Windows.Forms.BindingSource.CurrencyManager_CurrentChanged(Object sender, EventArgs e)
at System.Windows.Forms.CurrencyManager.OnCurrentChanged(EventArgs e)
I've isolated the problem in a small scenario:
private BindingSource m_bindingSource = new BindingSource();
public Form1()
{
InitializeComponent();
m_bindingSource.CurrentChanged += HandleBindingSourceCurrentChanged;
m_bindingSource.DataSource = new BindingList<StringValue>();
dataGridView1.DataSource = m_bindingSource;
btnAdd.Click += HandleAddClick;
btnRemove.Click += HandleRemoveClick;
}
private void HandleRemoveClick(object _sender, EventArgs _e)
{
m_bindingSource.RemoveCurrent();
}
private void HandleAddClick(object _sender, EventArgs _e)
{
m_bindingSource.Add(new StringValue("Some string"));
}
private void HandleBindingSourceCurrentChanged(object _sender, EventArgs _e)
{
// this line throws an exception when the last item is removed from
// the datagridview
btnRemove.Enabled = (m_bindingSource.Current != null);
}
}
public class StringValue
{
public string Value { get; set; }
public StringValue(string value)
{
Value = value;
}
}
Through pure experimentation, I've found that if I don't alter the button state in the CurrentChanged event handler, then everything works fine. So I suspect some sort of order of operations issue. But what? Why does attempting to make a change completely unrelated to the datagridview cause issues?
To make things even more interesting, the exception is usually harmless (or not showing up at all) if the program is started within VS with a debugger attached. But if it's executed on its own, there's a message box popping up with exception details.
I've tried handling the RowEnter event on the datagridview and found that in this scenario, it still thinks it has a row and attempts to retrieve the Current item from the binding source, but m_bindingSource.Current is already null. Why is this only an issue when the CurrentChanged event is handled?
Any and all help would be greatly appreciated. Thanks.
Maybe not a real answer but I remember BindingSource and Datagrid being picky and brittle in this department. My general advice would be not to use RemoveCurrent but to delete the record from the underlying datastore.
After some figgling, I've discovered some good news and some bad news for you:
The good news is that the (m_bindingSource.Current != null); part isn't the problem. That runs just fine.
The bad news is that the error is being caused by btnRemove.Enabled = false;
Do see what I mean, change: btnRemove.Enabled = (m_bindingSource.Current != null);
To:
btnRemove.Enabled = false;
if(m_bindingSource.Current != null)
btnRemove.Enabled = true;
The code will die on the first line.
I'm not 100% sure why, but if you move btnRemove.Enabled = false up to the first line of the HandleRemoveClick method everything works as planned.
Hope that's helpful to you.
I ran into the same problem today and found the workaround in this thread. Unfortunately I didn't like to split up the enable/disable code of the buttons. So I did some more research and found another solution, which worked for me.
All I did to resolve the IndexOutOfRangeException was to reset the bindings before I set the enable/disable of the buttons. (To optimize the performance you may check if the datasource count is zero or the position of the currency manager is -1. In other cases the reset isn't necessary.)
private void HandleBindingSourceCurrentChanged(object _sender, EventArgs _e)
{
if(m_bindingSource.Count == 0) // You also can check position == -1
{
m_bindingSource.ResetBindings(false);
}
btnRemove.Enabled = (m_bindingSource.Current != null);
}
Hope that's helpful.
I ended up resolving it like this:
private void HandleRemoveClick(object _sender, EventArgs _e)
{
btnRemove.Enabled = false;
m_bindingSource.RemoveCurrent();
}
private void HandleBindingSourceCurrentChanged(object _sender, EventArgs _e)
{
if(m_bindingSource.Current != null)
btnRemove.Enabled = true;
}
It's a little weird, but seems to be working fine.
Try replacing the CurrentChanged handler with:
private void HandleBindingSourceCurrentChanged(object _sender, EventArgs _e)
{
if (m_bindingSource.Position < 0) return;
btnRemove.Enabled = (m_bindingSource.Current != null);
}
I think the problem occurs because you are disabling a button that currently has the focus. There should be nothing wrong with disabling the focused control, but in certain circumstances it produced the described problem. If you the set the focus to some other control first I think you will see the problem go away. I was having the same problem and it worked for me.
Dim bCurrent As Boolean = CredentialTypeBindingSource.Current IsNot Nothing
'set focus to the New button which is never disabled
NewBtn.Focus()
'enable/disable the other buttons
EditBtn.Enabled = bCurrent
DeleteBtn.Enabled = bCurrent

ViewState is NULL in Page_Load but not postback

I've got a weird problem with a NullReferenceException on a high traffic website my company hosts. The exceptions are logged with full stack-traces but I am unable to reproduce it.
The exception occurs a couple of times a day, for different users, and it's a NullReferenceException thrown in the code block below:
protected void Page_Load(object sender, EventArgs e)
{
...
if (!Page.IsPostBack)
{
...
this.ViewState[StaticClass.StaticStringProperty] = StaticClass.StaticIntProperty; // this is the line the exception occurs on
...
}
}
The only place I can figure that a NullReferenceException would be thrown is if ViewState is NULL, but I've never known that and can't find any reason why this would be the case in a Page_Load that isn't a postback.
StaticStringProperty and StaticIntProperty are both initialised, static properties of StaticClass.
StaticStringProperty is defined as:
public const string StaticStringProperty = "IdFromClient";
Does anyone know how this could happen, or any other reason why a NullReferenceException would be thrown on the above line?
EDIT
As requested, the full stack-trace for the error is as follows. Line 54 is the line I've highlighted above.
at MyCompany.MyApplication.Appliance.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\shellama\My Documents\MyApplication\Appliance.aspx.cs:line 54
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at MyCompany.MyApplication.PageBase.OnLoad(EventArgs e) in C:\Documents and Settings\shellama\My Documents\MyApplication\App_Code\PageBase.cs:line 58
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The only thing I can say about it (I had a similar situation recently) is that StaticClass.StaticStringProperty is NULL. But then again, you must have paid attention to this. I can't think of something else.

Categories

Resources