Question: I'm learning about Java sockets, so I attempted to write two separate programs (a server side and a client side), and using swing to create a simple chatting program. Now the program works fine, I can see text sent from client-server and vice versa. However, the problem is when I terminate the connection from the server side. 

I understand that the two sockets are not necessarily related in way that if the connection is terminated at the server side, the client doesn't know about it, and keeps throwing IOExceptions at ObjectInput/OutputStreams. 

My question is, is there a way to notify the client about the server terminating the connection or should I accept the fact that the connection has to be terminated from the client side first?

Answer: 
Your code behind is missing the `Partial` keyword, e.g.

```
Partial Class QuerySql Inherits DBFunctions

```

Make sure that the designer generated class also has the same keyword to bind the ASPX file to your class.

If the designer file is missing you can regenerate it by right-clicking the ASPX page and selecting "Convert to Web Application"

[How do you force Visual Studio to regenerate the .designer files for aspx/ascx files?](https://stackoverflow.com/questions/45325/how-do-you-force-visual-studio-to-regenerate-the-designer-files-for-aspx-ascx-f?lq=1)
I have experience this problem as well. The vb.net web project i worked on, showed thousands of errors like 'BC30002 Type '....' is not defined. But this code did not seem to be faulty.

For me the following worked, but have no clue why!!:
Every designer class looked like this:

```
Partial Public Class CSSSRTOMOpleidersSearch

```

Removed the 'public' statement:

```
Partial Class CSSSRTOMOpleidersSearch

```

After that, the codebehind and designer were able to find each other