Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

when timer event rise it is blinking each time then i don't want to blink each time what i have to do next

$
0
0

<body>
<form id="form1" runat="server">
<div>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Panel ID="Panel1" runat="server">
<asp:Image ID="Image1" runat="server" BackColor="Aqua"
BorderWidth="2px" />

<asp:Timer ID="Timer1" runat="server" Interval="2000" ontick="Timer1_Tick">
</asp:Timer>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>

</form>

</body>

protected void Timer1_Tick(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
Bitmap bmp = new Bitmap(150, 500);
Graphics g = Graphics.FromImage(bmp);
// g.FillRectangle(Brushes.Red, 1, 1, 20, 500);
Pen blackPen = new Pen(Color.Red);
y -= 100; ;
height += 50;
RectangleF drawRect0 = new RectangleF(x, y, width, height);
Pen blackPen0 = new Pen(Color.Red);
g.DrawRectangle(blackPen0, x, y, width, height);

g.FillRectangle(Brushes.Sienna, x, y, width, height);
String path2 = Server.MapPath("~/Image/DrawRectangl.jpg");

bmp.Save(path2, ImageFormat.Jpeg);
Image1.ImageUrl = "~/Image/DrawRectangl.jpg";
if (height >= 520)
{
Response.Write("<h2>ERROR</h2>");
}
}


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>