How would you send InitParameters to Silverlight in an asp.net mvc app? -


First, I was sending information for a silverlight control inside page_load method .e.

  Protected Zero Page_load (Object Sender, EventArgues E) {Main container. Intermitters = "info =" + current user. ToString (); }  

In MVC, without the code-back concept, I have passed the User ID as part of the Model ID, but the following code is not working:

  & lt; ASP: Silverlight ID = "Main Container" Init Parameter = "info = & lt;% = Model. Current User ID% & gt;" Runat = "server" source = "~ / ClientBin / SilverlightControls.xap" ... / / gt;  

If you see the code provided to the browser, then it is avoiding MVC tags, so it's sent in this way:

  Value = "Info = & amp; amp; lt;% = Model. Current User ID & gt;"  

If I try hardcoding InitParameters = "info = 1", then it works.

& lt; Do not use asp: Silverlight runat = "server" /> control, it is a webform control and actually MVC is not in the world

Take a look at this blog post:

HTH, Charles


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -