473,387 Members | 1,453 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,387 software developers and data experts.

Need to show a list of controls on the page

Hello,

I have an interesting problem.

I wish to show a set of controls on a form repeatedly. Sort of like an
ASP.Net repeated, but without any data binding (I want to be able to put in
the data myself.

Basically, I am making a website which takes an RSS feed, and shows a list
of posts in the feed. Like Google reader. I want to to use ASP.Net Ajax
controls in the content, so I can't make a loop and spew pure HTML. I need
to use the actual controls, with the events and everything, and I don't want
to put in 50 controls on the form.

Is there any way to put all those controls on the form through code,
automatically?

Thank for any leads/ideas that you can give me.

Regards
Cyril

Apr 7 '08 #1
2 1175

"Cyril Gupta | सिरिल गुप्ता" <cy********@gmail.comwrote in message
news:86**********************************@microsof t.com...
Hello,

I have an interesting problem.

I wish to show a set of controls on a form repeatedly. Sort of like an
ASP.Net repeated, but without any data binding (I want to be able to put
in the data myself.

Basically, I am making a website which takes an RSS feed, and shows a list
of posts in the feed. Like Google reader. I want to to use ASP.Net Ajax
controls in the content, so I can't make a loop and spew pure HTML. I need
to use the actual controls, with the events and everything, and I don't
want to put in 50 controls on the form.

Is there any way to put all those controls on the form through code,
automatically?

Thank for any leads/ideas that you can give me.

Regards
Cyril
Use a repeater. Within the repeater you will define the set of controls for
each post. You then create a collection of posts from the RSS feed and
databind that collection to the repeater. You can use the <%# Eval("Name")
%format in the controls within the repeater but I find that handling the
ItemDataBound event will allow more flexibilty.

There is a starter kit which has a module for RSS feeds
http://www.codeplex.com/ASPNETPortal which might get you started.

Hope this helps
LLoyd SHeen

Apr 7 '08 #2
Hello Lloyd,

Thank you for the tip. Using a collection to databind is a good idea.

Meanwhile I've re-invented the wheel... I created a asp.net control to hold
my template, and then added a number of these controls to a panel.

Guess using a repeated is much easier! I will just check if I should trash
my code :)

Thanks
Cyril Gupta

"Lloyd Sheen" <a@b.cwrote in message
news:et*************@TK2MSFTNGP06.phx.gbl...
>
"Cyril Gupta | सिरिल गुप्ता" <cy********@gmail.comwrote in message
news:86**********************************@microsof t.com...
>Hello,

I have an interesting problem.

I wish to show a set of controls on a form repeatedly. Sort of like an
ASP.Net repeated, but without any data binding (I want to be able to put
in the data myself.

Basically, I am making a website which takes an RSS feed, and shows a
list of posts in the feed. Like Google reader. I want to to use ASP.Net
Ajax controls in the content, so I can't make a loop and spew pure HTML.
I need to use the actual controls, with the events and everything, and I
don't want to put in 50 controls on the form.

Is there any way to put all those controls on the form through code,
automatically?

Thank for any leads/ideas that you can give me.

Regards
Cyril

Use a repeater. Within the repeater you will define the set of controls
for each post. You then create a collection of posts from the RSS feed
and databind that collection to the repeater. You can use the <%#
Eval("Name") %format in the controls within the repeater but I find that
handling the ItemDataBound event will allow more flexibilty.

There is a starter kit which has a module for RSS feeds
http://www.codeplex.com/ASPNETPortal which might get you started.

Hope this helps
LLoyd SHeen
Apr 9 '08 #3

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

Similar topics

1
by: Georg Scholz | last post by:
Hello, The class "Control" contains a documented Property "ControlType". So for example, in a form, you can write code like this: Dim c as control set c = me.Controls("textbox1") if...
8
by: Tim Geiges | last post by:
Since I am being challenged with learning c# I figured I could pass some of the pain on to you guys :-) I have another question(this one is important for me to fix before I can get my app to Beta)...
10
by: hn | last post by:
Hi all, I have to design a quiz page which includes up to 200 questions. What users do is they start the quiz, go to page1 with question1, enter some answers, click next to go page2 with...
3
by: Wardeaux | last post by:
All, looking for sample project on how to add/edit/delete controls from an aspx page at runtime... any pointers is most appreciated!! My controls are simple: Label, Textbox, and DropList... I only...
5
by: dje | last post by:
In the OnClick event on a radioButtonList, I run a javascript to show/hide the appropriate div along with a submit button, which displays as expected. The problem is the submit no longer works on...
5
by: Chris | last post by:
Hi, What is wrong with this code? I can't figure this out. Its suppose to display ..a bunch ..of errors on my page. I am stuck for over 4 hrs now an this crap. Please assist. This is on...
2
by: Joanne | last post by:
Hi, I have an "interesting" problem with UserControls in a datagrid and I'm desperate for your help as I work alone and have no-one else to ask. It is quite complicated but I'll try to keep it...
1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
3
by: Terry Olsen | last post by:
I'm trying to add a domain user to a local group using the code below: Dim LCL As New DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim DOM As New...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...

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.