Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all. I create an empty asp web page which just show server time in a label located on top of the page.There is a hardware which can connect to this page through the url of the page and download the page on it's memory.the problem is how this hardware can download just the value of the label but not all page data. or on the other hand how I can create a page with just time data in it (without any other code)?

What I have tried:

C#
Label1.Text =DateTime.Now.ToString(@"yyyy/MM/dd hh:mm:ss:ff tt", new CultureInfo("en-US"));
Posted
Updated 24-Apr-16 23:35pm
Comments
Wombaticus 25-Apr-16 5:10am    
Well don't use a web-page - create a web service or just a simple generic handler to return the time value and nothing else.

1 solution

C#
protected void Page_Load(object sender, EventArgs e)
{
    Response.Clear();
    Response.Write(DateTime.Now.ToString(@"yyyy/MM/dd hh:mm:ss:ff tt", new CultureInfo("en-US")));
    Response.End();
 
Share this answer
 
Comments
mit62 25-Apr-16 6:40am    
Perfect. Thank you very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900