Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to get parameter from Asp.net web page to windows form

how to get parameter from Asp.net web page to windows form

Scheduled Pinned Locked Moved Visual Basic
csharpasp-nethelptutorial
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hemrk
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • H hemrk

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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 )

      H 1 Reply Last reply
      0
      • C Christian Graus

        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 )

        H Offline
        H Offline
        hemrk
        wrote on last edited by
        #3

        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.

        D 1 Reply Last reply
        0
        • H hemrk

          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.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          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

          H 1 Reply Last reply
          0
          • D Dave Kreskowiak

            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

            H Offline
            H Offline
            hemrk
            wrote on last edited by
            #5

            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.

            D 1 Reply Last reply
            0
            • H hemrk

              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.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              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

              H 1 Reply Last reply
              0
              • D Dave Kreskowiak

                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

                H Offline
                H Offline
                hemrk
                wrote on last edited by
                #7

                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.

                D 1 Reply Last reply
                0
                • H 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.

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups