placeholder proves problematic postback

F

Fraggle

I have a placeholder in a repeater, along with a textbox.

For each "repeat unit" I call the onitemdatabound method and decide
what I am going to put in the placholder, checkboxlist or
radiobuttonlist at the moment.

This is displayed (as a questionare) the user then ticks, selects, and
hits the "submit" button

On postback, what is stored in the placeholders is lost, and if i want
it back i have to rebind to the datasource, this apparently is by
design.

If i do rebind then i can read out what boxes were ticked, but the
rebind loses the values in the textboxes.

I am very frustrated, as I cannot imagine why this behaviour is
permitted, totally illogical and unfriendly. I also missed where this
is discussed in the docs for placeholders.

I need a solution that will either save the controls in the
placeholder, and on postback rebuild them, or let me read the 'old'
values in the textboxes before the data is rebound.

I dont even want the page re-displayed, preferably i would submit the
page to the server, it would read the data and enter it into the db
and throw up a "thanks" page.

Please help, or just send messages of support ;)

I dont use VS.Net, too poor.

Thanks
Fragg
 
F

Fraggle

Well I will admit to being a total novice to this, but i got a slight
hint of a sniff of a clue that moving my data bind to page_init may
help so i did

and it did

I have NO idea why seems like crazy madness to me but there you go.

If you are having problems with dynamicaly loaded controls being
forgoten then just bind them in page init and everything works.

Fragg

Sub Page_Init()

QuestionList.DataSource=Questions.GetQuestions(ModuleId)
QuestionList.DataBind()

End Sub


Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

End Sub
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top