Can this control be hosted in MVC web app?

Dec 13, 2011 at 8:40 PM

I am unable to make it work in MVC web app other than in home page.

Any time I access page (/view) using the routing URL, this control doesn't load.

If there is any sample/guidance to make it work, greatly appreciated.

Coordinator
Dec 13, 2011 at 8:44 PM

The control can work in any type of website. MVC is no problem.

You should check at which location you are trying to access the XAP file from your server. You can use Fiddler for that.
Maybe you have to modify the path to the control/XAP-file so it's able to load the Silverlight Multi File Uploader from the correct location.

Modify this line:
 <param name="source" value="ClientBin/mpost.SilverlightMultiFileUpload.xap" />

Dec 13, 2011 at 8:49 PM

Yes, I have all the init params setup correctly.

It works with the default route (Index.cshtml is configured in Global.asax). http://127.0.0.1:81/

However if I specify route explicitely for same page (index.cshtml) control doesnt load. http://127.0.0.1:81/home/index

 

Coordinator
Dec 13, 2011 at 8:52 PM

When you have the control at the root, this will be the location of the XAP file:

http://127.0.0.1:81/ + ClientBin/mpost.SilverlightMultiFileUpload.xap = http://127.0.0.1:81/ClientBin/mpost.SilverlightMultiFileUpload.xap

If you're in another view, this will become the location:

http://127.0.0.1:81/home/index/ + ClientBin/mpost.SilverlightMultiFileUpload.xap = http://127.0.0.1:81/home/index/ClientBin/mpost.SilverlightMultiFileUpload.xap

That's wrong.

Change this line:
<param name="source" value="ClientBin/mpost.SilverlightMultiFileUpload.xap" />

To this:
<param name="source" value="/ClientBin/mpost.SilverlightMultiFileUpload.xap" />

Dec 13, 2011 at 8:55 PM

Awesome, it worked. Great help and really appreciated.