<p>I am not concerned about other kinds of attacks. Just want to know whether HTML Encode can prevent all kinds of XSS attacks.</p>

<p>Is there some way to do an XSS attack even if HTML Encode is used?</p>

I don't believe so. Html Encode converts all functional characters (characters which could be interpreted by the browser as code) in to entity references which cannot be parsed by the browser and thus, cannot be executed.
```
```
&lt;script/&gt;
```
```
There is no way that the above can be executed by the browser.
**Unless their is a bug in the browser ofcourse.*