5 Answers, 1 is accepted
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:
aspx:
cs:
-Shinu.
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 |
{ |
display: none; |
} |
</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.
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:
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
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
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.