Jump to content
Sign in to follow this  
mus3na

Aspx Detect Browser Resolution

Recommended Posts

Terlebih dulu aku mintak maaf sebab bukak 2 thread. thread yg sama aku dah buat kat bahagian pembagunan web, tapi takde response. so aku nak tanya lak kat bahagian ni, mungkin expert2 sini tak jengok bahagian pembangunan web.

camana nak detect client browser width and height AKA screen resolution.

aku try code ni;

label1.text = request.browser.screenpixelwidth

label2.text = request.browser.screenpixelheight

bila run result aku dapat, Width = 640, Height = 480. masalahnya aku running screen resolution 1024*768. aku try dropkan screen resolution aku ke 800*600, tapi result tetap sama, 640*480.

aku develope aspx code using Microsoft Visual Studio .Net 2005, Version 8.0, base on VB.Net

Soalan Asal Aku.

http://forum.putera.com/tanya/t22929.html

PS: kalau mod rasa tak perlu aku wat redundance thread, please delete either 1, "aiman tak kisah."

Edited by mus3na

Share this post


Link to post
Share on other sites

kalau kat client ko tak leh guna server nyer code

ko kena guna client nyer.

guna javascript atau kalau asp.net guna registerscript

ni sample nak detect resolution

Sub ScreenResolution(sender as Object, e as EventArgs)

Dim myScript As StringBuilder = New StringBuilder()

myScript.Append("<script language='javascript'>")

myScript.Append("alert(screen.width)")

myScript.Append("<"&"/script>")

RegisterStartupScript("Screen", myScript.ToString())

end sub

oklahh good luck

Share this post


Link to post
Share on other sites

itu macam ka, so meriahla source code aku. ada vb, asp and java. hokhohkohkokho.... esok mlm aku kasi test drive.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...