Does a field exists in and ASP.NET web form?

September 18, 2017

Perty simple function. And yes, I still user ASP.NET web forms for somethings.

/// <summary>
/// Does a specfic element exists in a form
/// </summary>
/// <param name="Key">Form element to look for</param>
/// <returns>True if found</returns>
private bool formElementExists(string Key)
    bool formElementExists = false;
    for(int i = 0; i < Request.Form.Keys.Count; i++) {
        formElementExists = Request.Form.Keys[i].IndexOf(Key, StringComparison.InvariantCultureIgnoreCase) > -1 ? true : formElementExists;
    return formElementExists;
Tags  |  ASP.NET  |   |  Administrator

C# IsNumeric Function

October 19, 2016

If you're a fan of the old VB6 days one of the most useful functions was the IsNumeric function. Here is my version in C# and VB.NET (assuming you;re using .NET 4.0+):


public bool IsNumeric(string Value)
    // Check for blanks
    if (string.IsNullOrWhiteSpace(Value)) {
        return false;

    // Test for number
    double myNum = 0;
    return Double.TryParse(Value, out myNum);


Public Function IsNumeric(Value As String) As Boolean
    ' Check for blanks
    If String.IsNullOrWhiteSpace(Value) Then
        Return False
    End If

    ' Test for number
    Dim myNum As Double = 0
    Return [Double].TryParse(Value, myNum)
End Function


You can easily change to validate specfic numeric types by changing the last two lines from Double to something line Int32:


public bool IsInt(string Value)
    // Check for blanks
    if (string.IsNullOrWhiteSpace(Value))
        return false;

    // Test for number
    Inst32 myNum = 0;
    return Int32.TryParse(Value, out myNum);
Tags  |  C# |  VB.NET  |   |  Administrator

October 18, 2016

"Political terrorism": Search for suspects after GOP office firebombed in N.C.

Authorities are investigating after a local Republican Party office in North Carolina was vandalized and set on firein what a state GOP official called an act of “political terrorism.”

A bottle filled with flammable liquid was thrown through the window of the Orange County Republican Party headquarters overnight, damaging the interior before burning out, according to a Sunday news release from the town of Hillsborough. The office was empty and no one was injured.

         Characteristics of Political Terrorism
  1. Political terrorism involves an overall, overarching moral philosophy that is used to justify acts of terrorism, while criminal terrorism generally involves personal greed and selfishness. This is a very important point. There is a moral justification for the use of political terrorism, an ends justifies the means notion because we are going to yield a better overall social state. There is no such reasoning in the criminal terrorist.

  2. Political terrorism can involve activities to obtain money, but those dollars are used for political ends. Generally speaking, criminal terrorism has an economic basis.

  3. Political terrorists' targets tend to be almost indiscriminate and unpredictable. Usually no one person is particularly the target, therefore no one is safe. Criminal terrorists targets on the other hand tend to be more logical

    • a bank, an armored car - and the targets tend to be specific people, the bank official, the driver of the car.
  4. Political terrorists desire to create a long term atmosphere of fear, coercion and intimidation in the community. Criminal terrorists want to create a short term fear - scare the banker, get the money and get out of there.

  5. Political terroristic acts tend to be more savage - almost a shotgun philosophy - car bombs, nail bombs, double bombs all resulting in mass murder. The criminal terrorist tends to be more oriented to a specific target. Blow up this bank, hijack this plane.

  6. Neither political terrorism nor criminal terrorism abide by any rules or conventions of war.

  7. Often political terrorists are willing to die for the cause, while seldom do we see criminal terrorists planning on dying.

  8. Political terrorism differs from criminal terrorism in that political terrorism usually involves efforts to influence an audience. Generally speaking, the criminal terrorist does not want a big audience.

Paul Wilkinson, Terrorism and the Liberal State, London: Macmillan, l986. (Wilk.394 h/b)

Tags  |   |  Administrator

My thoughts on the debates last night

September 27, 2016
Cover Image

Ok, I've posted a bunch of other stories so I figure I would post my thoughts. I think Hillary won but just barely. You had so many facts and figures up her ass that she was more an encyclopedia. I still think she had an ear piece. Also the fact she kept pushing her damn book, now on sale at airports. Yeah, she said that in debate.

Then you had Trump looked like fucking Quasimodo because he started hanging on his lecturn after the first half hour. He had some chemistry that first 30 minutes and then his sciatica gave out. That last half hour he just ra out of steam and started mumbling. He should have gotten some Jolt cola filled with ibupropean.

I think Trump is getting a bit of bump out of this but it has to only because 90% of the people turned it off after that first 30 minutes.

Tags  |   |  Administrator