CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Variable in HTML code

Print topic Send  topic

Author Message
swilson


Posts: 84
Posted: 10/05/2005, 3:16 PM

This should be an easy one!

I sucessfully implemented a control called DynamicImage to resize images. Here is the html line used to do so:
<di:dynamicimage id="Dynamicimage1" runat="server" resizetowidth="30" imagefile="images/TwoDogs.jpg"></di:dynamicimage>

What I want to do is replace "images/TwoDogs.jpg" with a variable such as {image1} (the object I want to display) or photo_ (my database field holding the image path and name).

To be clear, my question is how do I use a variable in the html code in place of the file name in quotes??

THANKS!
_________________
It continues to amaze me, how often the solutions to seemingly complex problems are so very simple.
View profile  Send private message
Stan
Posted: 10/06/2005, 12:10 AM

ASP.NET doesn't support template variables. But you can reference this property from the custom code.

1) Declare your control into the code behind file by adding the following line of code before the Page_Load Event block:
protected <componentNamespace>DynamicImage Dynamicimage1;

Now in any event of the page you can reference it as
Dynamicimage1.ImageFile = "some value";

Stan

swilson


Posts: 84
Posted: 10/06/2005, 5:27 PM

I understand the principle now. Thanks, but need a little more coaching.

When I add the above as follows:
protected Dynamicimage1 As ProjXpert.DynamicImage

I get this build error:
HomePageEdit.aspx.vb(27) : error BC30002: Type 'ProjXpert.DynamicImage' is not defined.

Here is what I have at the top of the HTML:
<%@ register tagprefix="di" namespace="ProjXpert.DynamicImage" assembly="DynamicImage" %>
<add verb="GET" path="DynamicImageService.axd" type="ProjXpert.DynamicImage.DynamicImageHandler,DynamicImage" /><html>

In addition, I copied the .dll file to the bin directory and added the required lines to the web.config file as mentioned in the other post. The control works except my efforts to introduce this variable.

I appreciate your time to reply. THANKS!
_________________
It continues to amaze me, how often the solutions to seemingly complex problems are so very simple.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.