Custom Server Control Nightmare

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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.
 
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.
 
Back
Top