473,732 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying different controls in repeater, depending on condition

I am trying to use a repeater control in an ASP.NET application
(codebehind is C#), to display a bunch of error messages after a
validation has occurred.

In the codebehind, I have access to the type of error (severe or
warning). If the type of error is "warning", I want to display a
checkbox along with the error message. The user can then check this
box to override the error and continue. The checkbox should also be
prefilled with a database value if the user has selected override
before.

If the error is a severe error, this checkbox is not available and it
should only display a text value (something like "n/a").

I'd very much appreciate thoughts for how to do this.
Nov 18 '05 #1
1 2003
You need to inherit your own repeater and implement the ITemplate interface.
Here's a simple example of doing that. It is what I used as a starting
point for the custom repeater in the project I am working on now.

http://coltkwong.com/blogs/juliet/posts/467.aspx

Dale

"Shari" <sf*****@hotmai l.com> wrote in message
news:ee******** *************** *@posting.googl e.com...
I am trying to use a repeater control in an ASP.NET application
(codebehind is C#), to display a bunch of error messages after a
validation has occurred.

In the codebehind, I have access to the type of error (severe or
warning). If the type of error is "warning", I want to display a
checkbox along with the error message. The user can then check this
box to override the error and continue. The checkbox should also be
prefilled with a database value if the user has selected override
before.

If the error is a severe error, this checkbox is not available and it
should only display a text value (something like "n/a").

I'd very much appreciate thoughts for how to do this.

Nov 18 '05 #2

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

Similar topics

1
2078
by: John Smith | last post by:
How do I use two different data types with a conditional operator ? I want to cout either a character or an integer depending on a certain condition. cout << ((IsThisTrue? char:integer) The compiler seems to treat the char as an integer. The program prints out the decimal value of the char.
8
4279
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue which is related to the repeater. In the code shown below, if I call Repeater1.Controls.Count in the OnInit (the code fragment was highlighted in yellow) , the viewstate for the repeater will be lost during the postback. You can re-produce this...
4
7813
by: Bernie V | last post by:
Hi group, Is it possible to use a condition in a repeater control ? I 'd like to use a condition to create this <a href='<%#DataBinder.Eval(Container.DataItem,"nieuwsid")%>.aspx'> part of the repeater At the moment I use "nieuwsid" to make the url but in some cases it has to be <a href='wcharts.aspx'> Is that possible ?
3
4424
by: sorCrer | last post by:
Hi All, Posted after extensive searching! I have a nested repeater control as follows: (Simplified ;-)) <table> <asp:repeater id=parent onItemDataBound=createChild> <tr><td>Level 1</td></tr> <asp:repeater id=child>
1
1042
by: JRB | last post by:
Hi, I have a table stored in a database called "Compare" with three columns. The first column is the CompareID (it is an auto increment integer), the second is "Person1", and the third is "Person2". When one of my pages loads I pull the whole table into a DataTable. What I want to do is display each row on my page in a table allowing the user to choose either Person1 or Person2 for each row using RadioButtons to make the choice mutually...
5
5491
by: Brad Baker | last post by:
I'm completely new to ASP.NET programming, so please accept my apologies in advance for asking what is probably an obvious question. :-) I'm trying to write a page which will display the contents of an SQL record. I've added the following code to a file called default.aspx:
2
1249
by: John Kotuby | last post by:
Hi all, I have a page that displays the contents of a business document in HTML that uses multiple select queries to provide the relevent data. There is a call to the parent table and then multiple calls to related child tables. The selects that return multiple rows (details) I have placed in Repeater controls within the table that I use for formatting. I now face the task of producing multiple documents on the same page depending on a...
4
15464
by: Michael | last post by:
I have a repeater web control. Currently I want to change some row's color based on defined condition. Is there any code sample demonstrating how to accomplish it? Thanks.
1
1525
by: Jeff | last post by:
hi asp.net 2.0 On my webpage I want to display a list of images. Most proparly display the list horizontal Sometimes I want only one image to be displayed and sometimes maybe 10 images. It's the same image I want to be displayed several times in the list.
0
8946
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
8774
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
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...
1
9235
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
9181
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
8186
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...
0
6031
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
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
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.