473,325 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Refresh textbox in asp.net

Hi,

I need to refresh a text box in my web page every second to get the system date and time. Or else i wanna see the current date and time in a text box dynamically. Can any1 help please....

Thanks in advance
Nija
Jun 22 '07 #1
2 4050
nateraaaa
663 Expert 512MB
Hi,

I need to refresh a text box in my web page every second to get the system date and time. Or else i wanna see the current date and time in a text box dynamically. Can any1 help please....

Thanks in advance
Nija
Dynamically setting the current date time can be achieved easily by assiging DateTime.Now to the Text property of your text box. As far as updating the web page every second you may be able to achieve this using AJAX.

Nathan
Jun 22 '07 #2
Frinavale
9,735 Expert Mod 8TB
Nathan has correctly pointed out that you should probably use AJAX to achieve what you are trying to do.

I'm just going to point out that you are going to use up a lot of bandwidth doing this...every single second a browser is going to make a request to your server...if you have more than one browser connected to this, your bandwidth will be chewed up quickly.

I suggest using a client side script to do this for you.
There's no reason why your .NET code can't set the initial time value of a variable and have JavaScript or something update the clock on your page every second and have the browser take the workload...instead of constantly bombarding your web server with requests...its very expensive to do that.

-Frinny
Jun 22 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: jimvn | last post by:
while my screen saver (webshots) is active, my vb.net windows app updates a textbox. after exiting the password protected screen saver, the text box does not appear to be updated, but it has been,...
1
by: maria | last post by:
Hi I hope some one can help me I have a table of type <asp:Table>. This table is filled in runtime with labels and textboxes(also server controls). I have written a function i jscript since...
1
by: JBD | last post by:
Hi, I have a button that fires the below sub routine. This works fine if the user clicks the button as they are supposed to, even if they click it repeatedly. However, if you click "refresh" on...
1
by: ppatel | last post by:
Problem I have a problem with web image button control click event. The click event does not get trigger until it has not been clicked once or page refresh occures(which is fine). When click...
3
by: Steve Wark | last post by:
I have created a ASP.NET application and created two forms within the application (Webform1.aspx & Webform2.aspx). On the first form I have placed a textbox (TextBox1) and a button, which when...
3
by: *no spam* | last post by:
How do you refresh the controls on a panel? I've got a VB webform which contains a panel. On that panel is a checkbox and a textbox. I'd like the textbox to appear when the checkbox is checked...
2
by: Prodip Saha | last post by:
I am sure there is an easy fix for this problem. I am reloading the same page at an interval using the meta refresh tag in aspx page. This page has one textbox and one button. The problem is -when...
3
by: Patrick Olurotimi Ige | last post by:
I have a hyperlink below:- <asp:HyperLink ID="Hyperlink2"NavigateUrl='<%#"AddToCart.aspx?productID=" & DataBinder.Eval(Container, "DataItem.ProductID") >Add</asp:HyperLink> And i want to force...
1
by: silpa | last post by:
I have a form named dataentry1.aspx It has Name,Age,centimetres,metres textboxes. we will enter name in name textbox,age in age textbox. when we enter height in centimetres textbox, and after...
3
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
Ok guys, refresh my memory. I have a vague memory from years ago of a Dot Net 1.1 web app in which one window was opened from another (not a message box or anything like that, but a fully separate...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.