



![]()
In short you need to do a few things to make it possible to embed images into a dll file.
(c#)1) add an image to your (web) project
2) select the image and go to property -> “Build Action” and choose “Embedded Resource”
3) add this in your AssemblyInfo.cs “[assembly: System.Web.UI.WebResource("namespace.directory.imageName.png", "img/png")]“
4) in your *.cs file add this to show the image: Image1.ImageUrl = Page.ClientScript.GetWebResourceUrl(typeof(_Default), “namespace.directory.imageName.png”);
5) press f5, if there are no errors test the project using your webbrowser (localhost:yourPortNumber)
Download my project files here
// for my own reference only
old
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” >
<head><title>
Untitled Page
</title></head>
<body>
<form name=”form1″ method=”post” action=”default.aspx” id=”form1″>
<div>
<input type=”hidden” name=”__VIEWSTATE” id=”__VIEWSTATE” value=”/wEPDwUKMTk3MzY5NzU2Ng9kFgICAw9kFgICAQ8PFgIeCEltYWdlVXJsBX8vV2ViUmVzb3VyY2UuYXhkP2Q9TkxVeWFfSy1NeVVUdFhQRlRFLUlSZmNVNXZxY0Nya2dNRUxiY2IweE1YTGl6Y3NKWlpOVk95MDM3b3U5Q2VkcUhYSXV0OHFqSUo5Z04zYWpWUHlzancyJnQ9NjMzNjk5OTQ4NjI4MTI1MDAwZGRkGJdrne5DaxGKDYKjEM9W2u2rKA4=” />
</div>
<div>
<img id=”Image1″ src=”/WebResource.axd?d=NLUya_K-MyUTtXPFTE-IRfcU5vqcCrkgMELbcb0xMXLizcsJZZNVOy037ou9CedqHXIut8qjIJ9gN3ajVPysjw2&t=633699948628125000″ style=”height:133px;width:186px;border-width:0px;” />
</div>
</form>
</body>
</html>
New
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” >
<head><title>
Untitled Page
</title></head>
<body>
<form name=”form1″ method=”post” action=”default.aspx” id=”form1″>
<div>
<input type=”hidden” name=”__VIEWSTATE” id=”__VIEWSTATE” value=”/wEPDwUJMzk2MDQzMjE5ZGR7dTPBGX1u66LJZkHGMPuuDzWCqQ==” />
</div>
<div>
<input type=”hidden” name=”__EVENTVALIDATION” id=”__EVENTVALIDATION” value=”/wEWAwK978qBBALs0bLrBgKM54rGBl3Zfy1DAPCuPQn4rUg4hT3m1tl0″ />
</div>
<div>
<span id=”Label2″>Type a number higher than 1000 and lower than 100000</span><br />
<input name=”TextBox1″ type=”text” id=”TextBox1″ />
<input type=”submit” name=”Button1″ value=”Button” id=”Button1″ />
<img id=”Image1″ src=”" style=”border-width:0px;” />
<span id=”Label1″></span><br />
<br />
</div>
</form>
</body>
</html>


More Options ...
Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 