how to pass a string value to a type of expression?
<pre><code>public void Invoke(string methodname)
{
    string funcname=methodname.Split('.')[1];

    //funcname contains the value of CustomerController
    Type type = typeof(funcname);

    MethodInfo method = type.GetMethod(funcname);
    CustomerController c = new CustomerController();
    string result = (string)method.Invoke(c, null);
}
</code></pre>

<p>In this I need to pass a string value to a <code>typeof</code> expression which is a class name. But I’m getting an compile time error. In the above code</p>

<pre><code>Type type = typeof(funcname);
</code></pre>

<p>Here funcname contains the value <code>"CustomerController"</code>. If I replace it with the below line it works fine.</p>

<pre><code>Type type = typeof(CustomerController);
</code></pre>

<p>How can I pass a string value to a <code>typeof</code> expression?</p>
