You can use your up down box to set the variables in this simple function to generate a sine wave of the desired frequency and sample rate.
class SineGen
{
public double phaseCnt = 0;
public double sampleRate = 300;
public double freq = 10000;
public double sineWave()
{
double result = Math.Sin(freq * (2 * Math.PI) * (phaseCnt) / sampleRate);
phaseCnt++;
if (phaseCnt > sampleRate) phaseCnt = 0;
return result;
}
}
Within the loop or timer event you can populate a chart control using following lines of code.
mySineWave = _SineGen.sineWave();
this.chart1.Series["SineWave"].Points.AddXY(_SineGen.phaseeCnt, mySineWave);
For more on chart controls see here:
ASP.NET 4.0 Chart Control[
^]
Good luck.