Running a class function c#
Hi
I am having a problem running a function i have created in a class file. Each time I run the page using the function it comes up with the error: CS0103: The name 'Mid' does not exist in the current context
Here is how I have done it:
1. I created a new class file, which is residing in App_code folder
code as follows:
----------------------
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// Summary description for Mid
/// </summary>
public class Mid
{
public string Mid(string textString, int Start, int Length)
{
if (Start <= 0) { return null; }
if (Length > textString.Length - Start) { return textString; }
textString = textString.Substring(Start - 1, Length);
return textString;
}
}
--------------
But when I run the page which is using this function it gives me that error.
I ll appreciate any help.
|