473,587 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pass parameters to XBAP from webpage

I'm creating a XBAP application and want it take some input from webpage
dynamically? what is the best way? how to do it?

Best Regards
Steven

--
=============== ========
Steven Tang
SYWWUYU)
**:)
Oct 9 '08 #1
2 11296
Hello,

Welcome to Microsoft Newsgroup Support Service! My name is Marco Zhou. It's
my pleasure to work with you on this thread.

If I understand you correctly, you need to pass some data from ASP.NET web
pages to the XBAP application, if this is the case, there are two options
you could try out:

First option:

You could use cookie to pass data to XBAP application as follows:
At the codebehind of ASP.NET web page, you could simply write something
like the following:

// Construct the cookies.
HttpCookie cookie = new HttpCookie("MyD ata");
cookie.Value = HttpUtility.Htm lEncode("MyData ");

//Add to the response stream
Response.Cookie s.Add(cookie);

// Redirect the page to XBAP delopyment URI.
Response.Redire ct("http://localhost/XBapCookieDemo/XBapCookieDemo. xbap");

And in the XBAP application, you could retrieve the cookie using the
following method:

try
{
String cookie = Application.Get Cookie(BrowserI nteropHelper.So urce);
MessageBox.Show (cookie);
}
catch (Win32Exception )
{
}

Second option:

You could use query string to pass data to XBAP application, at the
codebehind of ASP.NET web page, you could write something like the
following:

String data = HttpUtility.Url Encode("MyData" );

// Pass the data using query string.
Response.Redire ct("http://localhost/XbapCookieDemo/XbapCookieDemo. xbap?MyDat
a=" + data);

And in the XBAP application, you could retrieve the data using following
method:

String queryString = BrowserInteropH elper.Source.Qu ery;
if (queryString != null && queryString.Len gth 0)
{
MessageBox.Show (queryString.Tr im('?'));
}

If you want to pass data after the XBAP application has launched, you could
try creating an ASMX or WCF service at the XBAP deployment site, so that
you could communicate data to XBAP application via ASMX and WCF service.

If you have any further questions on this issue, free feel to ask here, we
are glad to answer them.

--------------------------------------------------
Best regards,
Macro Zhou (v-*****@online.mi crosoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 10 '08 #2
Thanks a lot for helping:)
--
=============== ========
Steven Tang
SYWWUYU)
**:)
"Marco Zhou [MSFT]" wrote:
Hello,

Welcome to Microsoft Newsgroup Support Service! My name is Marco Zhou. It's
my pleasure to work with you on this thread.

If I understand you correctly, you need to pass some data from ASP.NET web
pages to the XBAP application, if this is the case, there are two options
you could try out:

First option:

You could use cookie to pass data to XBAP application as follows:
At the codebehind of ASP.NET web page, you could simply write something
like the following:

// Construct the cookies.
HttpCookie cookie = new HttpCookie("MyD ata");
cookie.Value = HttpUtility.Htm lEncode("MyData ");

//Add to the response stream
Response.Cookie s.Add(cookie);

// Redirect the page to XBAP delopyment URI.
Response.Redire ct("http://localhost/XBapCookieDemo/XBapCookieDemo. xbap");

And in the XBAP application, you could retrieve the cookie using the
following method:

try
{
String cookie = Application.Get Cookie(BrowserI nteropHelper.So urce);
MessageBox.Show (cookie);
}
catch (Win32Exception )
{
}

Second option:

You could use query string to pass data to XBAP application, at the
codebehind of ASP.NET web page, you could write something like the
following:

String data = HttpUtility.Url Encode("MyData" );

// Pass the data using query string.
Response.Redire ct("http://localhost/XbapCookieDemo/XbapCookieDemo. xbap?MyDat
a=" + data);

And in the XBAP application, you could retrieve the data using following
method:

String queryString = BrowserInteropH elper.Source.Qu ery;
if (queryString != null && queryString.Len gth 0)
{
MessageBox.Show (queryString.Tr im('?'));
}

If you want to pass data after the XBAP application has launched, you could
try creating an ASMX or WCF service at the XBAP deployment site, so that
you could communicate data to XBAP application via ASMX and WCF service.

If you have any further questions on this issue, free feel to ask here, we
are glad to answer them.

--------------------------------------------------
Best regards,
Macro Zhou (v-*****@online.mi crosoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 10 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1872
by: Scott Townsend | last post by:
I'd like to pass parameters to a local Application from a webpage. something like: <a href="file:///C:/Program%20Files/myapp/myapp.exe%20-custno:mycustno%20-quote no:12345%20-item:12345">test with params</a></p> Though it does not like it. If I leave off the Parameters it works fine.
13
26980
by: Al Franz | last post by:
Anyone understand how to pass parameters to a JavaScript. If anyone finds this easy to do maybe they could take a look at my short script on this page and show me how it needs to be changed. http://franz.org/java.htm Thanks for any help.
5
3938
by: Ben | last post by:
Hi I am using a User Control which is referenced by an ASPX page. How can I pass a string parameter to the user control, from the base ASPX page. Thanks Ben
6
3564
by: Woody Splawn | last post by:
I am using SQL Server 2000 as a back-end to a VS.net Client/Server app. In a certain report I use a view as part of the query spec. For the view, at present, I am querying for all the records in the table. But I am wondering if there is a way, at runtime, to pass values to the View (like start date and end date) so that I don't have to...
3
2109
by: Wang Xiaoning | last post by:
I have an customerdetail.xsl sheet ---------------------------------------------------------- <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="customer_number"></xsl:param>
3
8207
by: Joseph Lu | last post by:
Hi, all I have a stored procedure created in SQL Server like the following lines. // stored proceudre code starts here CREATE PROCEDURE sp_insertdata @strdata varchar(250) , @rsult BIT OUTPUT , @erridx CHAR(7) OUTPUT
0
2077
by: raghuraman_ace | last post by:
Hi i have started a webservice wich has a webmethod with parameters using literal encoding & encoded encoding . The webservice is compiled successfully . But i don know how to pass the parameters that satisfy these encodings . My web method is ---------------------------------------------
0
2103
by: PriyaManasarovar | last post by:
Can someone help how to pass parameters to a crystal report using a Crystal report object? I am using a console application & hence crystal report viewer cannot be used. And i need to pass the parameter through a batch file at run time? I have included a code here to pass parameters, but its giving invalid index error when i try to pass...
3
3172
by: Aussie Rules | last post by:
Hi, I have a few aspx (.net2) form. The first form allows the user to enter into text box, and select values from drop downs The second form needs to use these values to process some data. I am currently using the url to pass the values such as
3
2785
by: Vajrala Narendra | last post by:
Hi all Hi all, In my WF Project i have a CodeActivity, that is to check wether entered userid, password are valid or not how to pass parameters to CodeActivity. what i tried is in my class i wrote a method of bool type with userid, password as parameters, am checking here wether values are correct or not according to that am returning...
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.