Custom Server Control Nightmare

G

Guest

I am building a custom control that builds on the Textarea html control. I
have attached a toolbar on top of the Textarea that allows the creation of
buttons that will give the designer(during design-time) the ability to add or
remove buttons and their associated functions. These function associated
with the buttons are all client side programming because the round trip to
perform such things as making text bold would be impractical. Now, the
problem I am having, because these buttons rely on client side functions I
don't need a postback or round trip to the server. Nevertheless, when
pressed the button still posts back to the server and subsequently erases the
text in textarea. Am I going to have to set postback to false in the
server-control or do I have to rely on javascript to format the text during
the round trip and return the information based on the buttons instructions?
 
K

Kevin Spencer

Hi I Am Sam,

Unless there is some reason for you to use a Server Control, I would suggest
using a plain vanilla HTML button. Otherwise, yes, you will have to set the
IsPostBack to false.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
G

Guest

Hi Kevin Spencer.

Funny thing is that I have used a simple HTML Button:

<input type="image" src="somedirectory" onClick="Whatever_Client_Event" />

It still posts back for some reason.
 
K

Kevin Spencer

Hi I Am Sam,

You can call me Kevin. ;-)

An Image input element is a form element that works like a Sumbit button.
Use a regular image instead.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 

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,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top