473,800 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Load Image from codebehind

HI Guys, I need to load image in table cell from codebehind.

i have the following code:

TableRow tRow = new TableRow();
Table2.Rows.Add (tRow);
TableCell tCell1= new TableCell();
if (property[4].Value.ToString ()=="1")
{
tCell1.Image="t est";
}

tRow.Cells.Add( tCell1);

Thanks in advance
Manny
Nov 18 '05 #1
2 9313
Hi.

System.Web.UI.W ebControls.Imag e img = new Image();
img.ImageUrl = "/folder/blah_blah.gif";
img.Height = Unit.Pixels(20) ;
// Bunch of other "html like" properties are available for this type
//Or you can use img.Attributes collection to insert your own html/script
events attributes like this:
img.Attributes["onclick"] = "alert('Whateve r');return false;";
//Then
tCell1.Controls .Add(img);
//End of story
Regards,
Kikoz
"Manny Chohan" <Ma*********@di scussions.micro soft.com> wrote in message
news:60******** *************** ***********@mic rosoft.com...
HI Guys, I need to load image in table cell from codebehind.

i have the following code:

TableRow tRow = new TableRow();
Table2.Rows.Add (tRow);
TableCell tCell1= new TableCell();
if (property[4].Value.ToString ()=="1")
{
tCell1.Image="t est";
}

tRow.Cells.Add( tCell1);

Thanks in advance
Manny

Nov 18 '05 #2
Thank you. Will give this a try.

"Kikoz" wrote:
Hi.

System.Web.UI.W ebControls.Imag e img = new Image();
img.ImageUrl = "/folder/blah_blah.gif";
img.Height = Unit.Pixels(20) ;
// Bunch of other "html like" properties are available for this type
//Or you can use img.Attributes collection to insert your own html/script
events attributes like this:
img.Attributes["onclick"] = "alert('Whateve r');return false;";
//Then
tCell1.Controls .Add(img);
//End of story
Regards,
Kikoz
"Manny Chohan" <Ma*********@di scussions.micro soft.com> wrote in message
news:60******** *************** ***********@mic rosoft.com...
HI Guys, I need to load image in table cell from codebehind.

i have the following code:

TableRow tRow = new TableRow();
Table2.Rows.Add (tRow);
TableCell tCell1= new TableCell();
if (property[4].Value.ToString ()=="1")
{
tCell1.Image="t est";
}

tRow.Cells.Add( tCell1);

Thanks in advance
Manny


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2052
by: Greg Christie | last post by:
I think I have a somewhat unique situation here, so I thought I should post it for the few poor souls who run across it and try to google it like I did. First of all, I was getting the following error when trying to hit one of my pages... --------------------------------------------------------------------- Invalid URI: There is an invalid sequence in the string. ---------------------------------------------------------------------
2
2357
by: Christopher Ambler | last post by:
I'm wondering if there's a solution here - I have an ASPX page with a sole purpose of scaling an image. The ASPX page contains a single line with the codebehind tag, and the .cs file contains the code to read an image, use GDI+ to scale it to a reasonable size, and emit the image directly (setting content-type on the response and spitting out the bytes for the image). What I'd love to do would be to eliminate the ASPX page and be able...
1
2029
by: David Johnson | last post by:
Okay, creating an ASP.NET application with Visual Studio on a remote server (not local machine). It starts up with WebForm.aspx I put an image in webform.aspx, save it, and jump over to Internet Explorer, and surf to http://myserver/myproject/webform1.aspx. All is well, I see my image.
3
2747
by: Simon Harris | last post by:
Hi All, I have a data grid which displays country names. I now wish to display the country flag images above the names. Can someone please advise how I display an image in a datagrid? I have a folder of flag images, named in relations to the countries database ID. Current data grid code is...
4
2726
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the source of the files...
4
1945
by: simon | last post by:
have an image (acting like a button) currently that has onMouseOver and onMouseOut events. want to make this accessible to the codebehind with a click event. was able to right click at and choose "run as server control", when i double click it then to put code in the codebehind, there is no function there for me to fill in. i made up one called goButton_Click and handles gobutton.click that didn't work, didn't recognize the name i gave...
4
2758
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. It should put a blue and yellow box on the page with "This is a test" as part of the picture. But what I get is a broken Gif. The other problem is that I can't view the source???? The view source is disabled for this page. What causes this?
16
5049
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="<Namespace>." %> I've done a lot of things I've found on the web to no avial, but here are some unique things about what is happening to me.
8
13210
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project compiles & runs fine locally, but when I copy to the production machine, I get this error: Parser Error Message: Could not load type 'Global'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="Global" %> Source...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10276
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10035
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.