473,414 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

help plz!! Replace bit value with Image and bind it to repeater

Hi,

I am struggling to replace a bit value 'True' or 'False' with a image
true.gif or false.gif and bind it to a repeater control.

I am getting values 'true' or 'false' depending on whether user is logged in
or not(with asp.net membership provider)

Getting true or false with this <%#
Membership.GetUser(Eval("UserID")).IsOnline % and

getting the following error with this <%#
(Membership.GetUser(Eval("UserID", "Images/{0}.gif")).IsOnline)%>

plz help me to sort out this issue so that i can display image instead of
true or false.

..................Error details.........................................

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:

Line 41:
Line 42:
Line 43: <%# (Membership.GetUser(Eval("UserID",
"Images/{0}.gif")).IsOnline)% </td>Thanks in advance for helpSanju


Aug 31 '06 #1
2 1578
<%#
(Membership.GetUser(Eval("UserID", "Images/{0}.gif")).IsOnline)%>

Look at what you are asking here. Think it through for a minute:

Using membership and replace with a graphic by the name of the userid
Check if graphic is online

See a problem.

You are going to have to replace the string first and then bind. Without a
test, I do not have a sample of the code necessary and it might be
problematice even so.

Another option is the GridView (or DataGrid) data binding event, where you
can circumvent the natural order.

Also, how do you have this field set up? Is it templated with an image
control, or are you attempting to replace on the fly? If "on the fly" the
data binding event is your best option.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"sanju" <sa***@elogic.co.nzwrote in message
news:On*************@TK2MSFTNGP06.phx.gbl...
Hi,

I am struggling to replace a bit value 'True' or 'False' with a image
true.gif or false.gif and bind it to a repeater control.

I am getting values 'true' or 'false' depending on whether user is logged
in or not(with asp.net membership provider)

Getting true or false with this <%#
Membership.GetUser(Eval("UserID")).IsOnline % and

getting the following error with this <%#
(Membership.GetUser(Eval("UserID", "Images/{0}.gif")).IsOnline)%>

plz help me to sort out this issue so that i can display image instead of
true or false.

.................Error details.........................................

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:

Line 41:
Line 42:
Line 43: <%# (Membership.GetUser(Eval("UserID",
"Images/{0}.gif")).IsOnline)% </td>Thanks in advance for helpSanju


Aug 31 '06 #2
Hi, I got the solution.
its working properly when i use HTML image control.

Thank you
Sanju
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:e$**************@TK2MSFTNGP05.phx.gbl...
<%#
(Membership.GetUser(Eval("UserID", "Images/{0}.gif")).IsOnline)%>

Look at what you are asking here. Think it through for a minute:

Using membership and replace with a graphic by the name of the userid
Check if graphic is online

See a problem.

You are going to have to replace the string first and then bind. Without a
test, I do not have a sample of the code necessary and it might be
problematice even so.

Another option is the GridView (or DataGrid) data binding event, where you
can circumvent the natural order.

Also, how do you have this field set up? Is it templated with an image
control, or are you attempting to replace on the fly? If "on the fly" the
data binding event is your best option.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"sanju" <sa***@elogic.co.nzwrote in message
news:On*************@TK2MSFTNGP06.phx.gbl...
>Hi,

I am struggling to replace a bit value 'True' or 'False' with a image
true.gif or false.gif and bind it to a repeater control.

I am getting values 'true' or 'false' depending on whether user is logged
in or not(with asp.net membership provider)

Getting true or false with this <%#
Membership.GetUser(Eval("UserID")).IsOnline % and

getting the following error with this <%#
(Membership.GetUser(Eval("UserID", "Images/{0}.gif")).IsOnline)%>

plz help me to sort out this issue so that i can display image instead of
true or false.

.................Error details.........................................

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:

Line 41:
Line 42:
Line 43: <%# (Membership.GetUser(Eval("UserID",
"Images/{0}.gif")).IsOnline)% </td>Thanks in advance for helpSanju



Sep 13 '06 #3

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

Similar topics

3
by: Andy | last post by:
Can someone please help me with this problem? I don't know if this is possible in Java, so if it's not please point me in the right direction or to the right newsgroup! (I'm a newby to Java...
8
by: asd | last post by:
I need to find the value/index of the previously selected item of a select list. That is, when the user selects an item from the list and a certain condition elsewhere in the form is not met, I...
0
by: Balakrsihna | last post by:
Hi All, Can anyone tell me how to replace an image in MS Word 2003 using c#.net. I am converting an html file to word doc and sending this as attachment using System.Web.Mail; the...
0
by: dit | last post by:
Hello, I found this piece of code for selecting a dropDownlist value in a repeater: <aspropDownList id=ddl DataSource="<%# SourceTable %>" runat="server" DataTextField="Name"...
5
by: vedasri | last post by:
how the images can be placed side by side with help of css background image in <div>
1
by: sasha80 | last post by:
Hello everybody here is Sasha from russia ... I'm working as .Net 2005 application developer I prepare to gain MCPD certificate i have to pass three exams 70536(first) 70526(second)...
3
by: go4gator | last post by:
I'm a newbie, and I have an XML data file with Book data. I'm trying to replace a value with a string. Specifically trying to test for "if value is less than 5.00 than replace value with the string...
1
by: Charles Bronte | last post by:
Hey there; I'm working on creating a Wordpress plugin, but it turns out that my Regular Expressions-fu is lacking. How can you replace all image files (jpg, gif, jpeg)? I'm thinking a...
1
by: rahullko05 | last post by:
one line code to replace an image without page refresh
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.