473,698 Members | 2,300 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 2000
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
2074
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
4276
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
7810
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
4419
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
1040
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
5486
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
1247
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
15447
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
1523
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
8676
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
8608
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,...
1
8897
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
7732
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
6522
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
5860
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
4370
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...
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
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.