i have some textbox and some imagebutton.
When i type something in textbox and click enter i want my TextChanged event to fire which is working fine but at the same time it clicks one image button also and calls the method of that image button.
Can ne please help me on this.
Thanks in Advance
Loading
Suthish NairPosted Oct 28, 2010, 1:35 AM
ok.. if the helped you... its good.
Apurva MehtaPosted Oct 28, 2010, 12:26 AM
Isolved the problem.The problem and RCA is below :
Problem : When user click enter on any part of screen it calls the first Image button to fires and execute the button method.
Solution : What i did i place another image button at first position on aspx page and set its Width=".1px" which cannot be seen during runtime and Onclick of this image button i am calling a empty method.So one user click enter it dont fire any other image button.
Suthish NairPosted Oct 28, 2010, 12:04 AM
check couple of things..
1. document.forms["myform"].submit(); ==> remove this line if using.
2. search for ClientId imgItems on form, if any DefaultButton is used or not.
Apurva MehtaPosted Oct 27, 2010, 2:15 AM
//Button at aspx page
<asp:ImageButton ID="Image1" runat="server" OnClick="imgItems_Click"
ImageUrl="~/image/factory.bmp"/>
//Code for button
protected void imgItems_Click(object sender, ImageClickEventArgs e)
{
if (Page.IsValid)
{
Response.Redirect("First.aspx?Id=" + Id);
}
}
//TextChange method
protected void txt_TextChanged(object sender, EventArgs e)
{
//Some Calculation
}
Suthish NairPosted Oct 27, 2010, 2:09 AM
can you post the relavent code...