Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
1.60/5 (2 votes)
See more:
Hi Coders,

I have windows application in framework 3.5, windows server 2008 r2 operating system.
Here everything works fine.

Later I have moved the application to framework 4, windows server 2012 r2 operating system.

here while running the application its throwing runtime error like

Error:
"The WebBrowser control does not support the Cursor property."
exactly at
__browser.Cursor = Cursors.WaitCursor;

Immediately I saw the event viewer, it is showing the error
Error:

System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.GetResponse()
at StatService.SoftwareStatisticsHttpRequest.Post(String url, SoftwareStatisticsProxySettings proxySettings, Byte[] inData, Byte[]& outData)

I am unable to find why this error is coming. can you please tell me why this runtime error is coming.
Posted
Updated 10-May-15 21:49pm
v5

1 solution

As far as your Cursor problem is concerned, the WebBrowser does not support editing the Cursor. Read more about it at: https://social.msdn.microsoft.com/Forums/windows/en-US/caa06048-b90f-4fcf-842e-46da9c89882c/webbrowser-control-how-do-i-set-its-cursor?forum=winforms[^]. You are required to perform this action inside your HTML document. Probably using CSS would be a great idea, just write this CSS code for your HTML,

CSS
html {
   cursor: wait;
}


This would perform similar to what you want to do.

Secondly, the problem you are referring to it quite understandable by the error message, "The request was canceled." My guess to this would be that you are setting time out for the request (if you are admin of the web application) or second guess that the website you are trying to refer to requires "Same-Origin" policy. You cannot get resources from it. Quite other possible reasons. Why not debug it?
 
Share this answer
 
Comments
D-Kishore 11-May-15 4:20am    
Hi Ahmed, in that case for the first error: it should fail when running the application in framework 3.5 with server 2008 r2 also right.But there its running perfectly. i am having the issue in framework 4, windows server 2012 r2 only.
Afzaal Ahmad Zeeshan 11-May-15 4:37am    
Did you try using that HTML solution? WebBrowser control does not support direct editing the Cursor control. You can read about it on the MSDN link that I have provided.
D-Kishore 11-May-15 5:30am    
Thanks Ahmed, I will check and let you know

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