Forum  General Visual ...  How do I...?  How to call wgx with parameters from other web application
Previous Previous
 
Next Next
New Post 7/1/2010 1:49 AM
  mknet
8 posts
No Ranking


How to call wgx with parameters from other web application 

 Hi,

How to call wgx with parameters from other web application (ex. MainForm.wgx?Id = 1) .

 

 
New Post 7/1/2010 5:39 AM
  JamesC
849 posts
www.redcastle.co.uk
1st Level Poster




Re: How to call wgx with parameters from other web application 
Modified By JamesC  on 7/1/2010 8:39:42 AM)

Hi there

you will need to use the post prefix EG http://myserver/mywebsite/myform.wgx?myparam=1

then in myform_load you can extract the value of the parameter thus: string myparam = VWGContext,Current.Argumenst["myparam"].ToString();

The parameter is only available here (so you cant read it back in from, say, a button_click event later on)

To make the variable available later on, store the value in the form_load event into the session

VWGContext.Current["MYPARAM"] = myparam;

 

cheers james

 
New Post 7/1/2010 6:49 AM
  mknet
8 posts
No Ranking


Re: How to call wgx with parameters from other web application 

 Hi James,

I created a Demo with VWG 6.4 beta 3 and Visual Studio 2010 but your solution don't work.

this is the code in form_load, I have NullReferenceException : VWGContext.Current.Arguments["myparam"] is null

http://localhost:2701/Form1.wgx?myparam=1

       private void Form1_Load(object sender, EventArgs e)

        {

            try

            {

                string myparam = VWGContext.Current.Arguments["myparam"].ToString();

                MessageBox.Show(myparam);

            }

            catch (Exception ex)

            {

                MessageBox.Show(ex.ToString(), "Error");

            }

        }

best regards

 
New Post 7/1/2010 8:25 AM
  JamesC
849 posts
www.redcastle.co.uk
1st Level Poster




Re: How to call wgx with parameters from other web application 

sorry - i missed adding the post prefix to my example

 

heres what you need:

 

http://localhost:2701/post.Form1.wgx?myparam=1

 
New Post 7/1/2010 9:47 AM
  mknet
8 posts
No Ranking


Re: How to call wgx with parameters from other web application 

 Hi james,

thanks

best regards

 

 

 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  How to call wgx with parameters from other web application
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS