dzung
New member
- Joined
- Aug 4, 2019
- Messages
- 2
- Programming Experience
- 1-3
Hi there
I have created a website in ASP.NET and have created a class and put it inside of the App_Code folder. When I run the website locally (http://localhost:4300/Default.aspx), it works fine. However, when I upload it on to the server and run the browser, it produces a "Compiler Error Message: CS0103: The name 'StaticHelpers' does not exist in the current context".
Source Error:
Any suggestions will be greatly appreciated.
Thank you in advance.
I have created a website in ASP.NET and have created a class and put it inside of the App_Code folder. When I run the website locally (http://localhost:4300/Default.aspx), it works fine. However, when I upload it on to the server and run the browser, it produces a "Compiler Error Message: CS0103: The name 'StaticHelpers' does not exist in the current context".
Source Error:
Line 44: if (int.TryParse(redRange.Text, out red)) Line 45: { Line 46: color = StaticHelpers.getColor((byte)red, (byte)blue, (byte)green, bGray); Line 47: } Line 48: |
C#:
// The following codes are in Default.aspx.cs
public void showColorAndStatus()
{
green = int.Parse(rbl.SelectedValue);
blue = int.Parse(ddl.SelectedValue);
bGray = cbxGrayscale.Checked;
if (int.TryParse(redRange.Text, out red))
{
color = StaticHelpers.getColor((byte)red, (byte)blue, (byte)green, bGray);
}
_show.ForeColor = color;
_show.BackColor = color;
_status.Text = "";
}
// The following codes are in StaticHelpers.cs which resides in the App_Code folder.
public class StaticHelpers
{
public static Color getColor(byte red, byte blue, byte green, bool bGray)
{
Color color;
if (!bGray)
color = Color.FromArgb(255, red, green, blue);
else
{
int greyScale = (red + green + blue) / 3;
color = Color.FromArgb(255, greyScale, greyScale, greyScale);
}
return color;
}
}
Any suggestions will be greatly appreciated.
Thank you in advance.
Last edited by a moderator: