ASP.NET: Call .swf in .aspx page

user2826499

I'm trying the code below but its not working..

<object width="425" height="344">
  <embed src="C:\Users\fortress\Desktop\AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>

Also tried this. Not working also.

<object width="425" height="344">
  <embed src="~/Styles/Images/AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>

Problem:

  1. The swf is not displaying.
  2. I saw an error when I open the designer saying that "A control type was not specified or the specified type could not be found." I already import the shockwave-player for flash but still this error appeared..
  3. I want also that the .swf will be fullscreen played in .aspx.

I'm newbie in ASP.net.. SO yeah, please explain also the code if its okay...

Here's the output in client-side:

enter image description here

Here's the whole code for my client-side:

enter image description here

Thanks!

David

This isn't ASP.NET, this is HTML. It might be served to the client by an ASP.NET server-side application, but that makes no difference to the client.

As far as HTML goes, your paths are broken. In both cases:

  • C:\Users\fortress\Desktop\AppointmentApp.swf
  • ~/Styles/Images/AppointmentApp.swf

In the first case you're referencing a file system path. This wouldn't work on any client computer which doesn't have that file. If the file is on the web server then no client will be able to access the web server's C: drive. In the second case you're using a server-side relative path with a ~, and no client will be able to make sense of that.

When the page renders, the path needs to reference the file from the client's perspective. Something like this:

  • /Styles/Images/AppointmentApp.swf

Or perhaps:

  • ../../Styles/Images/AppointmentApp.swf

Or whatever the path is from the rendered page to the SWF file.

I'm not 100% sure if this works well for object/embed tags, but you might be able to use the ~ path reference if you make the tag a server-side control. That should just be as easy as adding runat="server" to the tag:

<embed runat="server" src="~/Styles/Images/AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>

This would indicate to the ASP.NET application that the control needs some server-side processing before it's rendered to the client, and that processing would include evaluating relative paths.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

ASP.NET Web Forms call embedded VB Code from another aspx. page

From Dev

Create a form on an ASPX page in asp.net

From Dev

Regex not working in asp.net(.aspx page)

From Dev

Refresh aspx page in ASP.NET tab panel

From Dev

Integrating a ASP.NET (.aspx) page into a existing Lightswitch project

From Dev

Jqgrid with asp.net [WebMethod] inside aspx page Issue

From Dev

How to return response to .aspx page from Handler in asp.net

From Dev

ASP.net default login.aspx page missing images

From Dev

Refresh aspx page in ASP.NET tab panel

From Dev

How to call .cs file from a .aspx.cs in asp.net

From Dev

HTTPS for only one ASP.NET page (Login.aspx), HTTP always for rest of site

From Dev

ASP.NET MVC4 with webforms Default.aspx as the start page

From Dev

ASP.NET - Hyperlink relative path to current URL on ASPX page not in code behind

From Dev

ASP.NET Web Application - publishing - not creating individual assembles (dlls) for each aspx page

From Dev

How to find user control kept inside another usercontrol from parent aspx page in asp.net?

From Dev

Find the Directory of folder in root from a aspx page which is inside a folder in asp.net

From Dev

Get user control element text from aspx page in asp.net

From Dev

Add an aspx page with code-behind to a compiled ASP.Net site

From Dev

Bind data and display datatable on aspx page using Jquery in asp.net on tbody

From Dev

Call a ascx Javascript function from .aspx page

From Dev

Call another aspx page in a different application

From Dev

Call classic ASP function from ASPX

From Dev

How to call Asp.net MVC page from Asp.net normal page?

From Dev

Call ASP.Net Page Method using jQuery

From Dev

Call WCF method OnUnload of ASP.NET page

From Dev

Markup Validation for asp.net aspx

From Dev

Printing an aspx file in Asp.net

From Dev

Markup Validation for asp.net aspx

From Dev

ASP.Net aspxerrorpath=/Login.aspx

Related Related

  1. 1

    ASP.NET Web Forms call embedded VB Code from another aspx. page

  2. 2

    Create a form on an ASPX page in asp.net

  3. 3

    Regex not working in asp.net(.aspx page)

  4. 4

    Refresh aspx page in ASP.NET tab panel

  5. 5

    Integrating a ASP.NET (.aspx) page into a existing Lightswitch project

  6. 6

    Jqgrid with asp.net [WebMethod] inside aspx page Issue

  7. 7

    How to return response to .aspx page from Handler in asp.net

  8. 8

    ASP.net default login.aspx page missing images

  9. 9

    Refresh aspx page in ASP.NET tab panel

  10. 10

    How to call .cs file from a .aspx.cs in asp.net

  11. 11

    HTTPS for only one ASP.NET page (Login.aspx), HTTP always for rest of site

  12. 12

    ASP.NET MVC4 with webforms Default.aspx as the start page

  13. 13

    ASP.NET - Hyperlink relative path to current URL on ASPX page not in code behind

  14. 14

    ASP.NET Web Application - publishing - not creating individual assembles (dlls) for each aspx page

  15. 15

    How to find user control kept inside another usercontrol from parent aspx page in asp.net?

  16. 16

    Find the Directory of folder in root from a aspx page which is inside a folder in asp.net

  17. 17

    Get user control element text from aspx page in asp.net

  18. 18

    Add an aspx page with code-behind to a compiled ASP.Net site

  19. 19

    Bind data and display datatable on aspx page using Jquery in asp.net on tbody

  20. 20

    Call a ascx Javascript function from .aspx page

  21. 21

    Call another aspx page in a different application

  22. 22

    Call classic ASP function from ASPX

  23. 23

    How to call Asp.net MVC page from Asp.net normal page?

  24. 24

    Call ASP.Net Page Method using jQuery

  25. 25

    Call WCF method OnUnload of ASP.NET page

  26. 26

    Markup Validation for asp.net aspx

  27. 27

    Printing an aspx file in Asp.net

  28. 28

    Markup Validation for asp.net aspx

  29. 29

    ASP.Net aspxerrorpath=/Login.aspx

HotTag

Archive