473,668 Members | 2,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.GetU ser(Eval("UserI D")).IsOnlin e % and

getting the following error with this <%#
(Membership.Get User(Eval("User ID", "Images/{0}.gif")).IsOn line)%>

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.NullRefe renceException: Object reference not set
to an instance of an object.

Source Error:

Line 41:
Line 42:
Line 43: <%# (Membership.Get User(Eval("User ID",
"Images/{0}.gif")).IsOn line)% </td>Thanks in advance for helpSanju


Aug 31 '06 #1
2 1594
<%#
(Membership.Get User(Eval("User ID", "Images/{0}.gif")).IsOn line)%>

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.c o.nzwrote in message
news:On******** *****@TK2MSFTNG P06.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.GetU ser(Eval("UserI D")).IsOnlin e % and

getting the following error with this <%#
(Membership.Get User(Eval("User ID", "Images/{0}.gif")).IsOn line)%>

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.NullRefe renceException: Object reference not set
to an instance of an object.

Source Error:

Line 41:
Line 42:
Line 43: <%# (Membership.Get User(Eval("User ID",
"Images/{0}.gif")).IsOn line)% </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.netNoS pamMwrote in
message news:e$******** ******@TK2MSFTN GP05.phx.gbl...
<%#
(Membership.Get User(Eval("User ID", "Images/{0}.gif")).IsOn line)%>

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.c o.nzwrote in message
news:On******** *****@TK2MSFTNG P06.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.Get User(Eval("User ID")).IsOnlin e % and

getting the following error with this <%#
(Membership.Ge tUser(Eval("Use rID", "Images/{0}.gif")).IsOn line)%>

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.NullRefe renceException: Object reference not
set to an instance of an object.

Source Error:

Line 41:
Line 42:
Line 43: <%# (Membership.Get User(Eval("User ID",
"Images/{0}.gif")).IsOn line)% </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
1758
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 scripting). On a web page I have a webcam type image that updates every minute. I wish to conditionally replace this image with an apology image in the event that my upload fails for more than an hour. I guess what I want is some script that will...
8
11597
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 need to display an alert box warning the user that a selection cannot be made, and redisplay the item that was previously selected. What is the most efficient way of doing this? Please email replies to tdk13@perfectsolve.com Thanks in advance.
0
5706
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 recipient could not see the image in attachment. I am using Inlinepicture.Addpicture but still not working
0
1516
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" DataValueField="Code" SelectedIndex='<%# ListIndex((DropDownList)target,DataBinder.Eval( Container.DataItem,"Code")) %>'></aspropDownList> SourceTable should be protected property in your page and its type is
5
2040
by: vedasri | last post by:
how the images can be placed side by side with help of css background image in <div>
1
1270
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) 70548(third) I need your help ... plz
3
4448
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 "Free". Here is what is not working but I receive no errors. <xsl:for-each select="value"> <xsl:if test="value &amp;lt;= 5.00"> <xsl:value-of select="Free" />" </xsl:if> </xsl:for-each>
1
2450
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 function with the following - Receive HTML in a string
1
2535
by: rahullko05 | last post by:
one line code to replace an image without page refresh
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8893
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...
1
8586
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
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
7405
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
6209
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
5682
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();...
2
2028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
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.