I have created my grid in windows and am hosting it in an asp.net page. My question is can I pass session variable to the winform from my asp.net form and vice versa?
Any help is greatly appreciated
I don't believe you are able to do this as a session variable. Now I might not be accurate in my terminology here but I think it because of how session states are handled. They are in two seperate system processes (or pools).
So for instance, when a user launches your asp.net form, it uses the aspnet_wp.exe.
When a user launches your web form, it uses your project.exe
Both of these are in seperate "pools" so to speak. So the data is not accessible between the two by direct means.
What I can suggest is two things. If you are sneding simple infomation, then using the query string might work.
However, that won't work with a datagrid. If you have a dataset that you want to pass from your winform to your asp.net application, I would look into sending it via XML. You can build an HTTP message in your winform (housing the datagrid) so that when a user sends the information, it builds the request, inserts the xml from the dataset, and sends it.
Then your asp.net page can most likely handle this. Unfortuantely I don't have any links to give you however, where I suggest you start is googling "Client Side XML ASP.NET" so that you get an idea of working with XML on the client side. Then take that and apply it to your situation.
My theory might not be the most efficient answer but it's based on your situation and what your trying to do. Perhaps there might be a better way all together of accomplishing your task.
Thanks for your suggesstion. Much appreciated. I like your idea. I will definitely try it.