.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Network Stream and Timer Control

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :ASP.Net

Hi all,

Please help me out here.... it has been a while that i have been looking around on the web for this and to no avail....

I basically have a network stream that i need to read on regular intervals in ASP.NET. The scenario is a chat application and i need to constantly check the network stream whether data has been pushed to it.

I tried ASP.NET AJAX TIMER CONTROL to read the network stream on Tick event (3 seconds interval). My aspx source looks like this:

 <asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
       <asp:AsyncPostBackTrigger ControlID="timer1" />

       <asp:TextBox runat="server" TextMode="MultiLine" Rows="30" Columns="100" ID="textbox1"></asp:TextBox>

In The Timer1_Tick event I have code to read the network stream.

However, I dont get any results in the textbox. I know data is being sent and received fine (i checked that using various techniques) so no problem there. The only problem is to CONTINUE TO READ THE NETWORK STREAM AT REGULAR INTERVALS and i cant figure out how that

View Complete Post

More Related Resource Links

Why ASP.Net AJAX Timer control stops ticking when we right click on the page?

Asp.Net AJAX Timer control stops ticking when I right click on the page. Actually i am updating a label using timer control for every second. When I right click on the page the label is not getting updated. I mean the timer stops ticking. Please tell me what is actually happening and how can i resolve it.

Label + Timer Control + Background color


Hi All,

            When my user sign in I want to show one Label control having Background color 'Green' for next 2 min's. After 2 min's it should become yellow and after 5 min's it should become red.

            I wrote sample prog for it. But I am not getting th proper output. Please help me for this.


<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        <asp:Timer runat="server" id="UpdateTimer" interval="5000" ontick="UpdateTimer_Tick" />
        <asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
                <asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
                <asp:Label runat="server" id="DateStampLabel" 
                    style="font-size: x-large; font-weight: 700" />

Timer control issues...page gets slower and slower....


 Hi all,

I have a Update panel with a Timer control inside the <ContentTemplate> so the JavaScript timing component is re-created only when each postback finishes. I am testing with static data in a small table. I query this table every 3 seconds. It works great for the first 5 min but then it starts to take longer to retrieve the data.... (I can see that with a time stamp I post back in a Label control).

I am not sure why that is happening. I thought that was because I had the Timer control outside the UpdatePanel (as I was using a Trigger) but I moved that inside the UpdatePanel but still get the same results.

What could be happening here?

Thank you


How do I set the Interval for a Timer control which is inside a Update control?


Hi all,

Basically I am trying to execute this code:

         <asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Enabled="True" Interval=Convert.ToInt32(ViewState["RefreshInterval"] />  


Error 1 Cannot create an object of type 'System.Int32' from its string representation 'Convert.ToInt32(ViewState["RefreshInterval"])' for the 'Interval' property.

Thank you


Keep session alive by using timer control



 To avoid that users get logged out when they haven't been active for a while, I am using a Timer-control to make a request periodically before the session times out.

My problem is that even though it is not shown (which is good), the entire page gets sent back to the client on each "tick" (25k or so, shown in Fiddler) and even if this is not really a problem, it would make me feel a lot better
if less data was returned (since I am really not doing anything anyway). I am using this code in my masterpage which all of my pages use.

I guess this should be easy to solve if I only had some more Atlas knowledge...
What am I doing wrong?

Grateful for any help,


Code on the client side:

<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true&

Flickering Problem while using a Ajax Timer Control to refresh a chart control in asp.net2010

Hi Everybody ,  

I am facing a flickering issue when i am trying to refresh a chart control on the tick of a timer .I am listing

below the code of my application ,Please help me remove this problem so that chart control get refreshed without any flickers on the specified time interval

Thanks in advance.

 C# code:

public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
        if (!Page.IsPostBack)
            MyLabel.Text = System.DateTime.Now.ToString();
            Txt1.Text = "Mohit";

    protected void Timer1_Tick(object sender, EventArgs e)

        Label1.Text = "Grid Refreshed at: " + DateTime.Now.ToLongTimeString();

    public void BindData()
        DateTime st = new DateTime(2010, 6, 1);
        int dys = 12;
        Dictionary<DateTime, long> dict = GetData(st, dys);

        foreach (DateTime d in dict.Keys)
            string xlab = d.ToString("M/d");

            DayOfWeek wd = d.DayOfWeek;
            if (wd == DayOfWeek.Sunday || wd == DayOfWeek.Saturday)
                Chart1.Series["weekends"].Points.AddXY(xlab, dict[d]);

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

In-Depth look at the GridView Control

In the last article we looked at few of the new controls available in Asp.net 2.0. We also talked about Grid View Control which has replaced the Asp.net 1.1 DataGrid control for good. In this article we will examine more features of the Grid View control. In this article we will see some of the common operations that can be performed using the GridView control. Apart from these operations there are many more functions that can be performed on the control and which we will see in the later articles

ASP.NET repeater control - databind with style

even used the inline editing features, which I at the time thought was the coolest way possible to write ASP.NET code ( I managed to write code to hide all other rows and only show the current one - the row being edited). With a nice looking EditTemplate it looked indeed very slick but it really turned into giant and hard to manage code behind files.

Creating Paging for a Repeater Control

A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Using TemplateFields in the GridView Control

The GridView is composed of a set of fields that indicate what properties from the DataSource are to be included in the rendered output along with how the data will be displayed. The simplest field type is the BoundField, which displays a data value as text. Other field types display the data using alternate HTML elements. The CheckBoxField, for example, renders as a checkbox whose checked state depends on the value of a specified data field; the ImageField renders an image whose image source is based upon a specified data field. Hyperlinks and buttons whose state depends on an underlying data field value can be rendered using the HyperLinkField and ButtonField field types.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher

Easily manipulate data with the GridView control in ASP.NET 2.0

Last week, I introduced ASP.NET 2.0's GridView data control and covered the basics of using it. This week, I go a step further by going into the details of working with the data contained in the control. This includes viewing, editing, and deleting data. Thankfully, the GridView control makes it easy to utilize these features. Before diving into these topics, I begin with an examination of the different field types supported by the GridView control.

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend