This is a migrated thread and some comments may be shown as answers.

Passing values from .aspx.cs page to .xaml.cs page residing in different project.

3 Answers 154 Views
Navigation
This is a migrated thread and some comments may be shown as answers.
Abhishek Chauhan
Top achievements
Rank 1
Abhishek Chauhan asked on 30 Sep 2009, 02:39 PM
Hi,

I need to pass the value of a variable from a .aspx.cs page in one project to .xaml.cs page in another project (No navigation required). Just to mention the two projects are part of a solution that has an n-tier architecture.

If anyone has already done that, please suggest me the solution.

Thanks in Advance,
Abhishek Chauhan

3 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 01 Oct 2009, 10:27 AM
Hi Abhishek Chauhan,

Please check this blog post:
http://www.dotnetspider.com/Silverlight-Tutorial-313.aspx

All the best,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Abhishek Chauhan
Top achievements
Rank 1
answered on 02 Oct 2009, 02:35 PM
Hi Valentin,

Thanx for the quick reply. Can you please tell me if it is possible to pass the values from a C# class library to the silverlight page (in another project) as well.
Actually i am calling a stored procedure that has an output parametrs in my data access layer (.cs file) as shown below-

public

 

DataSet GetWorkflowDetails(string userName,string selectedStage)

 

{

 

DataSet dtWorkflowDetails = new DataSet();

 

 

SqlParameter[] spParamaters = new SqlParameter[2];

 

spParamaters[0] =

new SqlParameter("@USERNAME",userName);

 

spParamaters[1] =

new SqlParameter("@SELECTED_WORKFLOW_STAGE", SqlDbType.VarChar, 50, selectedStage);

 

spParamaters[1].Direction =

ParameterDirection.Output;

 

 

 

using (DataAccess dataAccess = new DataAccess())

 

{

dtWorkflowDetails = dataAccess.DataSetFromStoredProcedure(

"SP_InboxWorkflowStatus", spParamaters);

 

selectedStage = spParamaters[1].Value.ToString();

 

 

//CommonMethods.WriteToLogFile(checkStage, string.Empty);

 

}

 

return dtWorkflowDetails;

 

}

The web service that I call in the .xaml.cs file, simply returns the Business logic method that calls the above mentioned method in DA layer.
Now the problem is that I need to pass the "selectedStage" variable (having the output parameter value) to the Silverlight application that resides in a different project.

Please help me if you have any idea how to achieve this.

Thanks in Advance,
Abhishek Chauhan

Now

0
Valentin.Stoychev
Telerik team
answered on 08 Oct 2009, 07:53 AM
Hi Abhishek Chauhan,

You can't pass it directly from the code behind. You need to pass it to the client side fist and then with javascript to pass it to Silverlight.

Let us know how it goes.

Best wishes,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Navigation
Asked by
Abhishek Chauhan
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Abhishek Chauhan
Top achievements
Rank 1
Share this question
or