推介:| 英語課程 | Causeway Bay order food | 職業英語 | 化妝課程 | Wedding Photography | 天窗卷布更換維修 |

發新話題
打印

網頁不會自動更新問題(asp)

If you want your web page to auto refresh, one of the simplest method is to add in the following code inside the head tag:

<meta http-equiv="refresh" content="5" >

The attribute http-equiv="refresh" calls for refresh of the page, 5 menas it will refresh every 5 seconds.

You should set the time to above 5 seconds because you have to consider the page reload time.

TOP

You have to ask the question correctly else it is very difficult for other to help you.

I now understand what you want......

Just add a sub to submit the form when you have updated the info, then you will see the new data.

TOP

引用:
原帖由 usnameless 於 2007-2-2 07:47 發表


一般鞝SP用VBScript access完Database 之後, 將data presents 好就放入html 中送到 browser for display.  之後如果data 在 database 中被改動, browser 中髼tml係唔會自動被update的.  你可以好似樓上咁講 ...
You are right that ASP will not auto fresh the page, but you can add a sub-routine such as button1_onclick, or if you have change something in the pull down menu, or change some text box you can use like:

Sub xxxx_onchange
  document.formx.submit()
end sub

In this case once you update the data say from ABC XYZ to DEF MNO, it will submit the form automatically and refresh the page, then you can see the new changed data immediately.

To refresh the page after you change the data in the form, you should add the line formx method= post action = abc.asp


相關搜索目錄: Database

TOP

It all depands on the application and what the programmer wants. In his earler post he mention that when he changed from ABC BBQ to BBQ ABC, the page will not show the changed until he clicks the refresh button. So, in order to show the new data without clicking the re-fresh button you can either (1) have auto re-refresh every x seconds, but this will eat up the resources, or (2) when there are changes, detect the changes and post the page again, although this involve a bit of codes, but you cannot get something from nothing right?

As for the bank, it is true that example Hang Seng and HSBC after you have done some transactions, the account summary will not show the new balance until you click the refresh. But HSBC of some branches example HSBC Malaysia, the account summary will show you the correct balance without clicking the refresh button.

So it depands on what you want the page to look like.


相關搜索目錄: BBQ

TOP

發新話題


重要聲明:本討論區是以即時上載留言的方式運作,本網站對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者發現有留言出現問題,請聯絡我們。本討論區有權刪除任何留言及拒絕任何人士上載留言,同時亦有不刪除留言的權利。切勿撰寫粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。


Copyright 1997- Xocat. All Right Reserved.