T
Thom Little
ASP.NET 1.1 Web Form
The intended operation ...
Enter String 1 in Text Box
Hit Show button
String is shown as an image
Hit Reset button
String is reset to null
Enter String 2 in Text Box
Hit Show button
String should be shown as and Image
This works great once.
The second time it insists on displaying String 1 and not String 2.
What is the DUMB mistake I am overlooking?
private void Page_Load(object sender, System.EventArgs e )
{
Response.Cache.SetExpires( DateTime.Now.AddSeconds( 1 ) );
Response.Cache.SetNoServerCaching( );
}
private void btnDebugShow_Click(object sender, System.EventArgs e)
{
string strUrl = Server.MapPath( "/temp/Debug.jpg" );
Bitmap bm = new Bitmap( 369, 32 );
Graphics g = Graphics.FromImage( bm );
RectangleF rf = new RectangleF( 4.0F, 4.0F, 369.0F, 32.0F );
Font fnt = new Font( "Arial Black", 12 );
SolidBrush sb = new SolidBrush( Color.Black );
g.Clear( Color.White );
g.DrawString( tbDebug.Text, fnt, sb, rf );
bm.Save( strUrl, ImageFormat.Jpeg );
imgDebug.ImageUrl = "http://www.tlatla.net/temp/Debug.jpg" ;
imgDebug.Visible = true ;
}
private void btnDebugReset_Click(object sender, System.EventArgs e)
{
tbDebug.Text = "" ;
imgDebug.Visible = false ;
}
The intended operation ...
Enter String 1 in Text Box
Hit Show button
String is shown as an image
Hit Reset button
String is reset to null
Enter String 2 in Text Box
Hit Show button
String should be shown as and Image
This works great once.
The second time it insists on displaying String 1 and not String 2.
What is the DUMB mistake I am overlooking?
private void Page_Load(object sender, System.EventArgs e )
{
Response.Cache.SetExpires( DateTime.Now.AddSeconds( 1 ) );
Response.Cache.SetNoServerCaching( );
}
private void btnDebugShow_Click(object sender, System.EventArgs e)
{
string strUrl = Server.MapPath( "/temp/Debug.jpg" );
Bitmap bm = new Bitmap( 369, 32 );
Graphics g = Graphics.FromImage( bm );
RectangleF rf = new RectangleF( 4.0F, 4.0F, 369.0F, 32.0F );
Font fnt = new Font( "Arial Black", 12 );
SolidBrush sb = new SolidBrush( Color.Black );
g.Clear( Color.White );
g.DrawString( tbDebug.Text, fnt, sb, rf );
bm.Save( strUrl, ImageFormat.Jpeg );
imgDebug.ImageUrl = "http://www.tlatla.net/temp/Debug.jpg" ;
imgDebug.Visible = true ;
}
private void btnDebugReset_Click(object sender, System.EventArgs e)
{
tbDebug.Text = "" ;
imgDebug.Visible = false ;
}