Confused about Repeater Events! Can anyone help?

  • Thread starter champ.supernova
  • Start date
C

champ.supernova

I have a repeater, which contains in its <HEADERTEMPLATE> a drop-down
list (set to autopostback).

If the page is a postback, I want to modify the SQL of the repeater's
datasource, DEPENDING ON the value of the drop-down list.

However, I can't evaluate the drop-down list submission at Page_Load,
because the repeater has not yet been databound or rendered, so
effectively the drop-down list doesn't yet exist.

However, if I test the drop-down list value in the Repeater's
OnItemDataBound event, then it's too late to modify the Repeater's
datasource SQL, as it's already databound.

How can I get around this? There must be a way of evaluating something
that exists in the Repeater's HEADERTEMPLATE section, before
databinding the repeater itself...?
 
E

Eliyahu Goldin

Something is not clear here. If you re-bind the ddl it will lose the user
selection. Is the ViewState enabled?

In any case you can always take the markup out of the HeaderTemplate and
place it just before the repeater. The html output will be the same. This
will separate the dll from the repeater.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
C

champ.supernova

Thank you Eliyahu,

The repeater handles table rows, and I actually thought the opening
<table> tag and initial rows had to be in the <headertemplate>, taking
them outside has solved the problem. Many thanks!


Something is not clear here. If you re-bind the ddl it will lose the user
selection. Is the ViewState enabled?

In any case you can always take the markup out of the HeaderTemplate and
place it just before the repeater. The html output will be the same. This
will separate the dll from the repeater.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net




I have a repeater, which contains in its <HEADERTEMPLATE> a drop-down
list (set to autopostback).
If the page is a postback, I want to modify the SQL of the repeater's
datasource, DEPENDING ON the value of the drop-down list.
However, I can't evaluate the drop-down list submission at Page_Load,
because the repeater has not yet been databound or rendered, so
effectively the drop-down list doesn't yet exist.
However, if I test the drop-down list value in the Repeater's
OnItemDataBound event, then it's too late to modify the Repeater's
datasource SQL, as it's already databound.
How can I get around this? There must be a way of evaluating something
that exists in the Repeater's HEADERTEMPLATE section, before
databinding the repeater itself...?- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top