Problem with Eventhandling in user control

F

Franz Fitz

Hi, I get really struggled, so it's my last chance to get some answers here.

My problem is: I would like to create a web user control that is based on a
XML structure. This XML structure is rendered thru a XSLT transformation on
the server (this would seperate the logic fro the design, and so, the
end-user can override the complete ui)

Example: I want to build a simple control with one textBox. The XML Data
contains a node named credentials and a node named username. The idea is now
to have the HTML Code for the UI rendering in the XSLT file. The logic and
the eventhandler should remain in the class.

The rendering is no problem, and it's handy to use. Only the eventhandlers
like Text_Changed are not working.

If anyone has an idea on why this is happening, I would
greatly appreciate it.

Thanks,
Franz
 
J

John Saunders

Franz Fitz said:
Hi, I get really struggled, so it's my last chance to get some answers here.

My problem is: I would like to create a web user control that is based on a
XML structure. This XML structure is rendered thru a XSLT transformation on
the server (this would seperate the logic fro the design, and so, the
end-user can override the complete ui)

Example: I want to build a simple control with one textBox. The XML Data
contains a node named credentials and a node named username. The idea is now
to have the HTML Code for the UI rendering in the XSLT file. The logic and
the eventhandler should remain in the class.

The rendering is no problem, and it's handy to use. Only the eventhandlers
like Text_Changed are not working.

If anyone has an idea on why this is happening, I would
greatly appreciate it.

Franz, are you saying that you have a control which performs an XSLT
transform on some XML in order to generate HTML? So the TextChanged event
you're referring to would be for a generated <input> tag?

If that's the case, did you generate the same code on your <input> tag as
ASP.NET would have generated for a TextBox control? In particular, do you
have the client-side event handling necessary to post back to the server?

Also, if you're creating your own <input> tags, note that you don't get
TextChanged events for free. Your control will need to somehow save the
value of the text box in ViewState, and handle the PostBack to see if the
ViewState value differs from the current value, and you will then have to
raise the event on your own.

I hope I'm misunderstanding you.
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top