推介:| 學英文 | Esse益生菌護膚品 | 駿寶燃氣工程 Chun Po Gas | 解夢分析師證書 | 銅鑼灣乾炒牛河 |

發新話題
打印

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

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

我想問0下點解我用asp 整完個網頁之後
每當我database update 0左野,佢都唔會更新,要我click refresh 先得呢?
係咩問題呢?
thx


相關搜索目錄: Database

TOP

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

引用:
原帖由 koon 於 2007-1-7 06:24 AM 發表
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" >

T ...
其實我唔係想要尼樣野

for example:

the page before I edit, and the first time I use browser was:

ABC BBQ
----------------------

After I updated the page like this:

BBQ ABC
---------------------

But after I enter the same URL, it remains:

ABC BBQ
----------------------


So I post this thread to ask how to update the page automatically without I use "Refresh buttom" to refresh the page, I don't need the page update every N seconds.

But nevermind, thank you for your reposonse


相關搜索目錄: BBQ

TOP

why u update the db instead of the asp page???

TOP

引用:
原帖由 s.vicente14 於 2007-1-17 04:49 PM 發表
why u update the db instead of the asp page???
You misunderstand what I mean......

here is what I want to show in abc.asp orginally:

ABC BBQ

I open the browser then see what I enter, but then I edit abc.asp as follow:

BBQ ABC

I enter the same URL/or open a new broswer, the result remains ABC BBQ, it change the value to BBQ ABC until I click "Refresh" button of broswer

My question is, how to automatically update the content without I click the "Refresh" Button, is it related to the history of browser?


相關搜索目錄: BBQ

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

Do you mean this ?



In the I.E. browser menu, select

Tools
Internet Options ...
General/Temporary Internet files / <Settings...>

In the "Every visit to the page", select "Check for newer version of stored pages"
人唔作出犧牲, 係唔會得到任何收獲, 要得到一樣野, 必定要付出對等嘅代價

TOP

收益匪浅,谢谢搂住!!!再接再厉!

TOP

引用:
原帖由 saxontse 於 1/6/2007 08:06 AM 發表
我想問0下點解我用asp 整完個網頁之後
每當我database update 0左野,佢都唔會更新,要我click refresh 先得呢?
係咩問題呢?
thx
一般鞝SP用VBScript access完Database 之後, 將data presents 好就放入html 中送到 browser for display.  之後如果data 在 database 中被改動, browser 中髼tml係唔會自動被update的.  你可以好似樓上咁講去set auto-refresh.  但要考慮麉Ysystem resource.  如果每個web client/browser 每5秒都query database 一次, 咁會拖低 performance.
其實一般鵁eb-base application 都唔會咁做.  這亦係web-base application 鮢hort-coming.


相關搜索目錄: Database
唔好話離開髐G十年, 即使到死o個日我都會係香港人!!!

TOP

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


一般鞝SP用VBScript access完Database 之後, 將data presents 好就放入html 中送到 browser for display.  之後如果data 在 database 中被改動, browser 中髼tml係唔會自動被update的.  你可以好似樓上咁講 ...
尼個真係我想知既答案
謝謝


相關搜索目錄: Database

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

引用:
原帖由 koon 於 2/3/2007 03:55 AM 發表

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  ...
其實都唔洗code咁多, 樓主refresh個client已經可以.  問題關鍵係, 唔似一D client/server application, data in database被updated, web-client 係好難被通知而update display緊魈nformation accordingly.  例如你on-line banking時 check你個account balance, 機乎無web-application會synchronize the dispalyed balance with the database after the initial request.  Data只會係for reference only.  又好似網上購物買飛, 見到有都不一定買到, 直至payment confirmed, 你先知道.  有D seller 好人D, 你proceed to check-out時佢已幫你hold 住件貨/D 飛 until session expire.

[ 本帖最後由 usnameless 於 2007-2-5 12:34 編輯 ]


相關搜索目錄: Database 購物
唔好話離開髐G十年, 即使到死o個日我都會係香港人!!!

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.