Archive

Archive for the ‘ASP.NET’ Category

Validation against Controls outside of the current NamingContainer

June 25th, 2017 Michael Bell 1 comment

I had a situation where I needed to do this recently. I googled of course, and came up with an overloaded FindControl method. I implemented this in my code, and all seemed well. UNTIL… came the time to get the data posted from my control. I had controls nested in a UserControl, and that usercontrol nested within a FormView. When the postback occurred, I was able to retrieve all values from controls directly in the formview but none from within the controls inside my usercontrol. A buddy of mine helped me out on this, and believe me.. it was no fun tracking down. the values “not being posted” was actually a flaw in the FindControl method override. Please use this piece of code in the naming container that your validators reside, if they in fact need to validate against controls outside:

protected override Control FindControl(string id, int pathOffset)
{
Control c = base.FindControl(id, pathOffset);
if (c != null)
return c;
return FindControl(Page, id);
}
public Control FindControl(Control parent, string id)
{
Control recurse;
if (parent.ID == id)
{
return parent;
}
foreach (Control child in parent.Controls)
{
recurse = FindControl(child, id);
if (recurse != null)
{
return recurse;
}
}
return null;
}
Categories: ASP.NET, Uncategorized, Whatever, c# Tags:

TimePicker Update

June 25th, 2017 Michael Bell No comments

As requested, I added functionality to the time picker to allow the up and down arrows on the keyboard to increase and decrease the values in the hours, minutes, seconds, and toggle the AM/PM box. I’ve also made the semi-colon seperators unfocusable.

Categories: ASP.NET, ASP.NET TimePicker Control, c# Tags:

ASP.NET TimePicker Documentation

June 25th, 2017 Michael Bell 14 comments

I finally got some documentation together for the TimePicker using Sandcastle and Docsite. For some reason I couldn’t get it to work as a subfolder or virtual directory of this site, so I have it on a funky port. Regardless, here is the link:

ASP.NET TimePicker Documentation

Categories: .NET TimePicker, ASP.NET, c# Tags:

.NET Time Picker Updates

June 25th, 2017 Michael Bell 10 comments

I released some updates night before last. One new function is the ability to make the picker work as a clock in nature, rather than… well.. a picker!

  • EnableClock is the new property that allows real time clock ticking action.
  • IsReadOnly has been renamed to ReadOnly (don’t know what I was thinking at the time), and it’s functionality has been imporved in that the numbers in the clock are not even selectable from the user interface when this option is set to true.
  • The control now will return seconds, when AllowSecondEditing is set to true.

That and I updated the time picker example page to reflect these new changes: .NET Time Picker Example Page

Categories: ASP.NET, c# Tags: