This is a migrated thread and some comments may be shown as answers.

RadTextBox button server click missing?

5 Answers 246 Views
Input
This is a migrated thread and some comments may be shown as answers.
Roland
Top achievements
Rank 1
Roland asked on 27 Jan 2010, 03:41 PM
I cannot find the RadTextBox button server click event.

I would expect it to be there since this is a button/

How to get server click event working ?

How to add tooltip to the button ?

Roland

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Jan 2010, 06:42 AM
Hello Roland,

The OnButtonClick client-side event handler is called when the user clicks on a button associated with the input control. One suggestion to fire a server event is invoking postback explicitly from the client event handler. Add one invisible button on page and invoke the click method of that which will simulate the buttonclick event.

css:
 
    <style type="text/css"
        .hideButton 
        { 
            displaynone
        } 
    </style> 

aspx:
 
<telerik:RadTextBox ID="RadTextBox6" runat="server" AutoPostBack="True" 
    ShowButton="True"
    <ClientEvents OnButtonClick="OnButtonClick" /> 
</telerik:RadTextBox> 
 
<asp:Button ID="Button2" runat="server" CssClass="hideButton" Text="Button" OnClick="Button2_Click" /> 

cs:
 
    protected void Button2_Click(object sender, EventArgs e) 
    { 
        Response.Write("Button clicked"); 
    } 

-Shinu.
0
Roland
Top achievements
Rank 1
answered on 28 Jan 2010, 02:47 PM
I was thinking about this, but this is inside user control. I have 10 of those on the page.

I ended up creating ASP image button.
0
Natalia
Top achievements
Rank 1
answered on 17 Aug 2011, 11:54 PM
Hi,

I am developer an user control wich create a RadTextBox and set the property ShowButton= true and the button appears to the right of the textBox.
Now I need to attack to click event button an ajax event in server side. For that I am using the following line of code:
 

 

 

 

protected override void CreateChildControls()

 

{

....

 

txtBox1.ClientEvents.OnButtonClick =

 

"BtnClick";
....
}

and I create the method:

 

 

 

void BtnClick(object sender, EventArgs eventArgs)

 

{

 

}

 

 

But the BtnClick method doesn't fires. How can I do this without use javascript, just server side.

Please help me.

Mickna.


0
Les
Top achievements
Rank 1
answered on 20 Apr 2013, 02:29 PM
I have the same issue....any thoughts on this?
0
Pavlina
Telerik team
answered on 24 Apr 2013, 04:17 PM
Hello Mickna,

In this article you can read more about the OnButtonClick event. It can not be used for your purpose.

All the best,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
Roland
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Roland
Top achievements
Rank 1
Natalia
Top achievements
Rank 1
Les
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or