Passing values to a Windows Control in a Web Form

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

0
coolvaas1
7/11/2006 3:18:51 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

2 Replies
918 Views

Similar Articles

[PageSpeed] 15

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.

0
votek
7/11/2006 5:02:55 PM
Thanks for your suggesstion. Much appreciated. I like your idea. I will definitely try it.
0
coolvaas1
7/18/2006 2:27:42 PM
Reply: