posts - 3, comments - 2, trackbacks - 0

My Links

News

Article Categories

Archives

Post Categories

Thursday, March 26, 2009

Submit button unexpected postback in WebBrowserControl

In .NET, When you add an event handler to any of the predefined events in HtmlDocument of WebBrowserContro.Document, it will register a default event handler for all the other events. 

If the submit button has an onclick javascript event handler. The javascript returns false to prevent the page to postback. However, return false will not work properly if there is another event handler registered. Instead of returning false, the best choice in the HTML page is to set event.returnValue = false.

Another workaround is to change your .NET code, use AttachEventHandler method instead:

Private Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles Button1.Click  
    doc = webBrowserControl.Document  
    doc.AttachEventHandler("onclick"AddressOf oDoc.OnClick)  
End Sub 
 

Remove Handles doc.Click in your code.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, March 26, 2009 11:21 AM | Feedback (0) |

Monday, March 23, 2009

Visual Studio Tip: Navigate to File by Typing File Name

In Visual Studio, press CTRL+D, type ">of <FileName>", replace <FileName> with real file name.

Visual Studio can also list all possible files for you.

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, March 23, 2009 10:55 AM | Feedback (2) |

Thursday, March 12, 2009

TFS Error: The process cannot access the file ProxyStatistics.xml

Recently my customer encounters the following errors in TFS 2005:

Exception Message: The process cannot access the file 'X:\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Web Services\VersionControl\App_Data\ProxyStatistics.xml' because it is being used by another process. (type IOException)

Finally, we found that it is because that TFS application pool in IIS is configured to use multiple worker processes. Please configure it back to 1 to solve this problem.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, March 12, 2009 1:59 PM | Feedback (0) |

Powered by: