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

4 posts, 0 answers
  1. Abhishek Chauhan
    Abhishek Chauhan avatar
    29 posts
    Member since:
    Sep 2009

    Posted 30 Sep 2009 Link to this post

    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
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 01 Oct 2009 Link to this post

    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.
  3. DevCraft banner
  4. Abhishek Chauhan
    Abhishek Chauhan avatar
    29 posts
    Member since:
    Sep 2009

    Posted 02 Oct 2009 Link to this post

    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

  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 08 Oct 2009 Link to this post

    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.
Back to Top