Validating integer or string input
You are clearly violating the Single Responsibility Principle (SRP) because the method is doing two things. You should use two methods where each validates one type only.

You will see also that for this task you gain the advantage that the methods will be smaller and easier to read and understand.

A small side note: In .NET methods are named using PascalCase,  so isValid should be IsValid.

Don't omit braces {} although they might be optional. By always using them your code will become less error prone.



Another quick remark about the method in question. You have defined optional parameters min = 0 and max = 0. I would expect if parameters are optional, that they could return true for a bool method. Using this method without specifying min and max will result in false which is unexpected.  

Integrating the said points into extension methods would look like so  

public static bool IsInRange(this int value, int min, int max)
{
    return min &lt;= value &amp;&amp; value &lt;= max;
}  

public static bool HasValidLength(this string value, int maximumLength)
{
    if (value == null) { throw new ArgumentNullException("value"); } 

    return value.Length &lt; maximumLength;
}  


which could then be called through this methods

public static bool IsValidInteger(this string value, int min = int.MinValue, int max = int.MaxValue)
{
   int v = 0;
   return int.TryParse(value, out v) &amp;&amp; v.IsInRange(min, max);
}  

public static bool IsValidString(this string value, int maximumLength = 30)
{
    return value != null &amp;&amp; value.HasValidLength(maximumLength);
}


like e.g  

if(userInput.IsValidInteger(0, 5))
{
   // do something awesome
}