Beruflich Dokumente
Kultur Dokumente
Add the object element to your HTML and specify attributes and a child param element as shown in the
following example.
Note:
You will typically specify additional HTML to provide an installation experience and ensure cross-browser
compatibility. For a complete HTML example, see the end of this topic.
Copy Code
<object width="300" height="300"
data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" >
<param name="source" value="SilverlightApplication1.xap"/>
</object>
The width and height attributes are required for cross-browser compatibility. You can specify fixed pixel
values or percentages relative to the width and height of the parent element. If you use relative sizing,
you can respond to plug-in size changes by handling the Content..::.Resized event. For more information,
see Silverlight Plug-in Sizing.
The type attribute and the specific value shown are also required. This value uses the Silverlight MIME
type to identify the plug-in and the required version. For more information, see Silverlight Versioning.
The data attribute and its value are recommended to avoid performance issues on some browsers. Note
the trailing comma in the data value. This indicates a second data parameter that has an empty value.
Add HTML content to the object element after the child param elements, as shown in the following
example.
Copy Code
<object id="SilverlightPlugin1" width="300" height="300"
data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" >
<param name="source" value="SilverlightApplication1.xap"/>
<!-- Display installation image. -->
<a href="http://go.microsoft.com/fwlink/?LinkID=124807"
style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181"
alt="Get Microsoft Silverlight"
style="border-style: none"/>
</a>
</object>
This example shows the default install image source and installer URIs. With these URIs, the server
detects the user's browser settings to provide the correct version of the installation image and installer. If
the user's browser is not supported, clicking the image causes the browser to open the Silverlight
Requirements page.
The following illustration shows the default installation image:
You can provide arbitrarily complex alternate HTML in order to integrate the Silverlight install experience
with your Web page. However, in many cases, users will have to restart or refresh their browsers after
installing Silverlight. With Internet Explorer, only a browser refresh is required unless the user has an
older version of Silverlight installed and upgrades through the installation link.
You can refresh the browser automatically or eliminate the refresh requirement by using helper functions
in the Silverlight.js file. You can also use Silverlight.js to perform fine-grained browser requirements
detection. For more information, see Silverlight.js Reference.
Example
Description
The following code example provides a complete HTML page for a Silverlight application that uses the entire
browser window. This example is based on the default HTML used by Visual Studio when you choose to dynamically
generate a test page.
This example uses cascading style sheets (CSS) and a div element to contain the plug-in. This ensures that the
plug-in extends to the edges of the browser window. This and other additions to the HTML help ensure cross-
browser compatibility.
Note:
Because of browser differences, the Silverlight plug-in does not support the cascading style sheets (CSS)
overflow property on the object element or on a parent container element, such as a div element.
The iframe element is also for cross-browser compatibility. The presence of the iframe prevents the Safari
browser from caching the page. Safari caching prevents the Silverlight plug-in from reloading when the user
navigates back to a previously-visited Silverlight page. For more information, see the Safari Developer FAQ.
This example uses a JavaScript function to handle the plug-in's OnError event. A JavaScript error handler is useful
during debugging, but you typically remove it when you deploy your application.
This example also includes minRuntimeVersion and autoUpgrade settings to provide an upgrade experience if
the specified version of Silverlight is not installed. For more information, see Silverlight Versioning.
To view this example in your Web browser window, you must specify a valid Silverlight application package in the
source parameter. For more information, see How to: Create a New Silverlight Project.
Code
Copy Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<!-- saved from url=(0014)about:internet -->
<head>
<title>SilverlightApplication1</title>
<style type="text/css">
html, body {
height: 100%;
overflow: auto;
}
body {
padding: 0;
margin: 0;
}
#silverlightControlHost {
height: 100%;
}
</style>
<script type="text/javascript">
function onSilverlightError(sender, args) {
var appSource = "";
if (sender != null && sender != 0) {
appSource = sender.getHost().Source;
}
var errorType = args.ErrorType;
var iErrorCode = args.ErrorCode;
var errMsg = "Unhandled Error in Silverlight 2 Application " +
appSource + "\n";
errMsg += "Code: " + iErrorCode + " \n";
errMsg += "Category: " + errorType + " \n";
errMsg += "Message: " + args.ErrorMessage + " \n";
if (errorType == "ParserError") {
errMsg += "File: " + args.xamlFile + " \n";
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
else if (errorType == "RuntimeError") {
if (args.lineNumber != 0) {
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
errMsg += "MethodName: " + args.methodName + " \n";
}
throw new Error(errMsg);
}
</script>
</head>
<body>
<div id="silverlightControlHost">
<object width="100%" height="100%"
type="application/x-silverlight-2"
data="data:application/x-silverlight-2," >
<param name="source" value="SilverlightApplication1.xap"/>
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="2.0.31005.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=124807"
style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181"
alt="Get Microsoft Silverlight"
style="border-style: none"/>
</a>
</object>
<iframe
style='visibility:hidden;height:0;width:0;border:0px'></iframe>
</div>
</body>
</html>
SQL CRUD Application Wizard
Last Revised On: 24/04/2009
Project Overview
The SQL CRUD Wizard for PHP is a sample .NET application that can be used to generate a simple "Create,
Read, Update, Delete" PHP application from a Microsoft SQL Server database table. The generated PHP
application supports paging, sorting and simple CSS customization.
Architecture
The generated PHP Application Code, generated by the PHP to SQL CRUD Wizard, includes logic for CRUD
functionality between the PHP application and a SQL Server database instance on the web server.
Note that the web server environment can be Linux/Apache, Windows/Apache or Windows/IIS.
Screenshots
Enter your database credentials:
Select Database, Table and Fields:
Set styles for generated PHP files
Requirements
Windows XP, Windows Vista
Microsoft SQL Server Express 2005 or 2008
A PHP installation