How To Pass 'user' Object From Aspx To Silverlight 4

Dec 28, 2010

First, we are constrained to using an existing web framework that handles authentication and authorization. The web project uses forms authentication and writes to an encrypted cookie. The user information is exposed to the aspx pages as a property:

LoggedInUser.Current

This has several properties including the userId and role list.

I've looked at using initParams, but haven't been very successful there (edit: I couldn't do it dynamically originally). I've created a simple POCO entity with a [Key] attribute, but I need to at least be able to pass the userId from the aspx page to the imbedded silverlight.

What is the easiest way to pass a dynamic object from aspx to silverlight 4?

[Code]....

Then used Slugster's example to use the values on the Silverlight side.

Warning: Passing user information via init params exposes the info as plain text to the user viewing the page (they just have to view the source). We ended up using an authentication domain service and using the same user object as the aspx

View 2 Replies


Similar Messages:

Accessing Silverlight Object Data From Aspx Page?

Jul 29, 2010

I am new to silverlight and I am wondering if it is possible to access silverlight object data from the aspx page that host it. Or have silverlight write to a hidden field on the page on client side.

What I am trying to do is to use silverlight to upload file via WCF (client to WCF Service directly instead of posting data back to the web server then forwarded to WCF service). When uploading a large file, user can still do some data entry etc. And once the upload is done have it write some data return by the WCF service to the aspx's hidden field and postback to the server on submit.

View 1 Replies

Web Forms :: Pass Values Between User Controls On Two Different Aspx Pages?

Sep 12, 2010

I have 2 user controls that is hosted by 2 different aspx pages.

example:

srcpage.aspx --> hosts the --> sourceusercontrol.ascx
and
destpage.aspx --> hosts the --> destinationusercontrol.ascx

I would like the values in the text fields of the sourceusercontrol.ascx to be passed on to the labels in the destinationusercontrol.ascx.

I have gone through the MSDN ASP.Net examples and i was able to successfully pass values between two aspx page using the postback URL functionality, but cannot do the same thing with the usercontrols on 2 different aspx pages.

View 4 Replies

User Controls :: How To Pass Value From UserControl (ASCX) To Page (ASPX)

Jan 19, 2014

I have two files in my project. One is user control (popup) customerpicker.ascx and one is default.aspx page. In customerpicker I have dynamically generated gridview and 'select' column with SelectButton.

What I want is this: When I click on 'select' on random row in gridview, then I like to display value from selected row immediately (like ajax) to aspx.page. How it is possible?

There is part of my code in .ascx:

public string showOnaspx { get; set; }
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
GridViewRow row = GridView1.Rows[e.NewSelectedIndex];
showOnaspx = row.Cells[1].Text;
e.Cancel = true;
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView1.SelectedRow; 
//row[i].Attributes.Add("onclick", "$('#ContentIndex_sometextbox).val(" + row[i].Cells[1].Text// + "); $('#Close').click();");
}

I also tried with jqeury (comment in selectedindexchanged function), but it does not work well, because user have to click SELECT two times to effect.

View 1 Replies

Forms Data Controls :: Pass Parameter To Object Datasource In User Control?

Jun 30, 2010

I have a gridview inside a user control bind to an object datasource. Now I want to bind the object datasource with a parameter from parent page.

For this purpose I defined a public property in user control but how do I pass it with object datasource ?

I am calling from parent page like

myusercontrol.parameter=querystring["id"];

How to bind object datasource with my parameter ?

View 4 Replies

How To Pass List Of Values To Silverlight

Sep 13, 2010

I want to pass the data from asp.net to silverlight.I tried for jquery to pass data from asp.net to silverlight.but it not working.

View 2 Replies

Silverlight - CGI And Debugger - Can't Pass Through URL Because Actual Request Is Coming From Server

Oct 4, 2010

I've got a Silverlight app that has to accept some initial data when it fires up. That data, unfortunately, MUST come from XML input. In addition, I can't just pass it through the URL because the actual request is coming from a server external to my own.

So the basic setup is this: Remote server needs to launch my app. Remote server pops open a window on the user's PC with a URL directed at a CGI application that can accept the XML input. The CGI app parses the input and spits out an HTML page containing the Silverlight app with all of the init params set. Long story short: When the Silverlight app is opened this way I can't debug it. I attach to the process, but none of the break points can be hit.

I tried every way in the world to get the ASP.NET page that would normally host the Silverlight app to accept the XML in the URL but it would get stripped by ASP.NET because of security reasons and no amount of modifying the config file would fix it (since it was stemming from the other web server presumably).

View 1 Replies

Web Forms :: Pass The Selected Value Of A Dropdown List From Page1.aspx To Page2.aspx?

Mar 11, 2010

I have 2 pages Page1 has a dropdownlist, page2 has this on pageload:

View 5 Replies

AJAX :: JavaScript Function To Pass Value From MasterPage.aspx To Default.aspx And Then Refresh UpdatePanel

Feb 26, 2011

For example, I have master page MyMasterPage.aspx and content page MyDefault.aspx. I have many UpdatePanels at MyMaterPage.aspx, and also I have many UpdatePanels at MyDefault.aspx.

[code]....

I want JavaScript functionClickMenu(this) at input button [id="ButtonMaster1" @ MyMasterPage.aspx] pass its value ["Menu-1"] into text box [id="TextBoxDefault1" @ MyDefault.aspx], and then performing update / doing post-back to server ONLY FOR UpdatePanelDefault1.

I am looking forward an example code for JavaScript functionClickMenu(this).

View 4 Replies

How To Call Javascript Function On A Silverlight 3 Object

Jan 12, 2010

I have the following Silverlight control defined:

[Code]....

I have exposed the following method in my Silverlight control (Page.xaml.cs) to be accessible to Javascript:

[ScriptableMember]
public bool HasPendingUpdates()
{
return btnSave.IsEnabled;
}

I then have a Javascript test function in my aspx page that is trying to do something with it:

var imageViewer = $("#objImageViewer")[0];
if (imageViewer.Content.Page.HasPendingUpdates())
{
alert("Pending Changes Exist!");
}
else
{
alert("NO Pending Changes Exist!");
}

Problem is that it fails after the Content object. I have tested the following:

var imageViewer = $("#objImageViewer")[0];
imageViewer // Valid
imageViewer.Content // Valid
imageViewer.Content.Page // Invalid
imageViewer.Content.HasPendingUpdates() // Invalid

So I am not sure what I am doing wrong. How do I get to the function within Content?

I am using IE8, Silverlight 3, ASP.NET. The silverlight control is created with the object tag as I don't think the control is an option in Silverlight 3+.

View 2 Replies

Web Forms :: Serialize And Deserialize An Object Using SilverLight?

Jul 8, 2010

I'd like to serialize and deserialize an object using SilverLight.

View 2 Replies

Web Forms :: How To Embed Silverlight Xap Into Aspx Page

Feb 21, 2010

How to embed silverlight xap into aspx page. I have created students database. I want to keep search option to find student name. It should be done in silverlight. I want to embed that silverlight in aspx page.

View 6 Replies

How To Load An Aspx Page From Silverlight Frame

Oct 6, 2010

I have two frames in a Silverlight application.

One frame contains a TreeView control. When a user clicks on one of the TreeView's items then I want an ASPX page to be loaded into the next frame.

How can I achieve this?

View 1 Replies

How To Get SilverLight Control Values On Aspx Page

Feb 15, 2011

i have made a user control carrying a grid which is showing different uploaded images , description etc. I am putting this in another aspx page and want to fetch the values of the silverlight grid. I have made a class file for that but unable to get the grid collection.

View 1 Replies

Accessing Username In Silverlight Application From Aspx?

Apr 2, 2011

I need to access signed in username and pass, which are saved in session variable,

from silverlight page

i remember something of accesing session variables from silverlight but cannot get the code

cannot remember the name of the video, which shows how to interaction between aspx page and silverlight plugin

View 1 Replies

How To Create A Hybrid Silverlight And Aspx Application

Jan 21, 2010

We have an ASP.Net 2.x web site. We want to migrate it to Silverlight full frame application. However, there is no way we can go away in a corner and redo every web page in SL right off the bat.

What I would like to do is build the chrome of the app (main page, dashboard, login, common system/config screens, main menu) in SL and be able to open existing .aspx pages in the main content SL frame.

From what I see there is no way to do this. I thought the Webbrowser control in SL4 would be the answer, but apparently that only works if your app is run out of browser.

So, what is my best recourse? It seems like I will have to create some type of .aspx page that hosts the .XAP and pass in the page I want it to load?

View 1 Replies

Web Forms :: Embed Silverlight App In Aspx File?

Feb 14, 2010

I've created a silverlight application, MainPage.xaml has silverlight controls. The code behind of it will be definately in MainPage.xaml.cs file. When creating a silverlight app, I've selected a default web project wherein this silverlight app will be hosted and run. After all my work in MainPage.xaml.cs file, I want to integrate it in my default.aspx file. As i understand, I need to give reference to xap file in this aspx file. I tried accessing

<asp:Silverlight ID="xx" runat="Server.. />

tag but had no luck. This tag does not come up, Am i missing to add reference to any silverlight dll to my web application. Or is this tag applicable for Silverlight 2.0 and not 3.0 which I'm using:

<object data="SilverlightEmployeeExampleTestPage.aspx" width="100%" height="100%">
<param name="source" value="../ClientBin/SilverlightEmployeeExample.xap" />
</object>

View 2 Replies

Delay In Silverlight Initialization In Aspx Page?

Jul 23, 2010

We have a silverlight/asp.net application which communicates with WCF to fetch data. Now we are facing a problem where in the silverlight component is taking some time to initialize after the asp.net page life cycle is completed.We have tried tracing all the events and found that there is a time lapse between the aspx page unload event and silverlight initialize event. This we have tried with even a simple application (hello world) but still have found the same result.There is nearly 3-4 seconds delay i.e the silverlight component initialization starts 3-4 seconds after the page unload event ends.

View 1 Replies

How To Send Data From Silverlight Application To A Aspx Page

Sep 2, 2010

I want to send data from my silverlight application to a aspx page. But i don't want to pass parameter in the url when calling the aspx page.

So i figure the best way is to do a POST. But i'm not too sure how to do it..

View 1 Replies

Web Forms :: How To Call Silverlight Testpage.aspx In Usercontrol

Sep 10, 2010

I used usercontrol in asp.net I want show silverlight control in that usercontrol .How I do it I cannot understand?

View 3 Replies

Html - Calling A Silverlight Component In Aspx Page?

Jul 15, 2010

I'm calling a silverlight component in my aspx page like this

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="silverlightControlHost" > [code]...

I would like to modify my page aspx so it takes the parameter itself. Today I'm calling the page

Config.aspx and I would like to do something like this call it

Config.aspx?ConfiguredCarId=11

How do I modify the above code to reflect the change?

View 1 Replies

Importing An Aspx Page Into Silverlight In Expression Blend?

Aug 23, 2010

I have an aspx masterpage that I would like to use in Sketchflow in ExpressionBlend as a Silverlight project. I am totally out of my comfort zone here and am not even sure how to ask this question. This masterpage has a Header and a Footer and the middle section will contain the Content - which will actually be Silverlight. Is there some easy method to bring the design (aspx) into Sketchflow to use?

View 1 Replies

MVC :: How To Pass JSON Object As Dictionary Object

Oct 23, 2010

In MVC3 Beta version i have action result same like

public ActionResult Save(Dictionary<string, string> dicObject)

I want to pass JSON Object in POST Method from javascript and need to get as dictionary object

How can i do this? can you write example if possible?

View 5 Replies

Web Forms :: How To Pass The Value From .aspx Page To .aspx.cs

Oct 19, 2010

I have to pass the value [sysid] for getting the value from another table.

I coded asp:

[code]....

View 7 Replies

How To Open Aspx Page In New Browser Window From SilverLight Application

Oct 6, 2010

I want to add a button to my user control in SilverLight 4.0 application which will open a new browser window with an aspx in it when it is clicked.

Additionaly, can I lock the SL application until this new window is closed (Alike a modal dialog)?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved