how to get parameter from Asp.net web page to windows form
-
hello, i am stuck. i have one web application. i want to pass contract number from my web page and give a link to open my windows form with contract number and search all the details for that contract number and populate it in the forms. so basically i want to pass the parameter from web page to my windows form to populate all the related fields. hemaxi
-
hello, i am stuck. i have one web application. i want to pass contract number from my web page and give a link to open my windows form with contract number and search all the details for that contract number and populate it in the forms. so basically i want to pass the parameter from web page to my windows form to populate all the related fields. hemaxi
IS the web form running inside your app ? If not., you're creating a link to the exe and assuming it's in a known location ? You can pass parameters to an exe on the command line.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
-
IS the web form running inside your app ? If not., you're creating a link to the exe and assuming it's in a known location ? You can pass parameters to an exe on the command line.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
No. Web form is not running in my windows application. both are seperate applications but now we want to merge it. so we decided, instead of writing code again , we call windows application from webpage and pass the parameter. my question here is how to fetch that parameter in windows main form. ex. if i am passing parameter called "ID" with .exe. when windows application is loading that time i need to know "ID" so that i can write code in FORM_Load event to populate other fields from the table for that "ID". Pls. reply asap.
-
No. Web form is not running in my windows application. both are seperate applications but now we want to merge it. so we decided, instead of writing code again , we call windows application from webpage and pass the parameter. my question here is how to fetch that parameter in windows main form. ex. if i am passing parameter called "ID" with .exe. when windows application is loading that time i need to know "ID" so that i can write code in FORM_Load event to populate other fields from the table for that "ID". Pls. reply asap.
You can get the command line arguments using Environment.GetCommandLineArgs[^].
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
You can get the command line arguments using Environment.GetCommandLineArgs[^].
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Excellent..but Where to write...i've main form in solution. and i dont know how the asp.net team is going to call my windows application. is there any other way. Thanks for ur help. Hemrk.
Nope. And you can make the call to get the command line args anywhere you need to in your code. Before you start writing it though, you better sit down with the ASP.NET guys and come to an agreement on the format of the arguments you're going to use. Also, you might also want to discuss with them the security problems you're going to run into running an external .EXE from inside the web-browser. This is normally not allowed unless you've made changes to IE's security policies.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Nope. And you can make the call to get the command line args anywhere you need to in your code. Before you start writing it though, you better sit down with the ASP.NET guys and come to an agreement on the format of the arguments you're going to use. Also, you might also want to discuss with them the security problems you're going to run into running an external .EXE from inside the web-browser. This is normally not allowed unless you've made changes to IE's security policies.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Thanks Dave. Its working fine. yes..i was thinking to meet asp team and find out how they are going to call my exe. actually we are working on the same project so there is not security issues as its for our internal office users..so doesnt have to worry about security ..but i dont know whether they are going to pass the parameter commandline or not. anyways do u have any idea how to pass commandline arguments with calling exe from asp .net ?let me know so i can tell them to use that way. Thanks again Hemrk.
-
Thanks Dave. Its working fine. yes..i was thinking to meet asp team and find out how they are going to call my exe. actually we are working on the same project so there is not security issues as its for our internal office users..so doesnt have to worry about security ..but i dont know whether they are going to pass the parameter commandline or not. anyways do u have any idea how to pass commandline arguments with calling exe from asp .net ?let me know so i can tell them to use that way. Thanks again Hemrk.
hemrk wrote:
so doesnt have to worry about security
Uhhh, the security issue isn't going to be something that you setup. It's going to be something that you have to relax to get it to work. The browser defaults will not let you do this.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008