当页面下载而不是所有代码数据时,如何从ASP页面获取特殊数据? [英] How can I get just a special data from an ASP page when page was downloded not all code data?

查看:48
本文介绍了当页面下载而不是所有代码数据时,如何从ASP页面获取特殊数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我创建了一个空的asp网页,它只是在页面顶部的标签中显示服务器时间。有一个硬件可以通过页面的URL连接到这个页面并下载页面的内存。问题是如何此硬件只能下载标签的值,但不能下载所有页面数据。或者另一方面我如何创建一个只包含时间数据的页面(没有任何其他代码)?



我尝试了什么:



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:

Label1.Text =DateTime.Now.ToString(@"yyyy/MM/dd hh:mm:ss:ff tt", new CultureInfo("en-US"));

推荐答案

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();


这篇关于当页面下载而不是所有代码数据时,如何从ASP页面获取特殊数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆