text changed event of textbox

Posted by Klbaiju under ASP.NET on 8/4/2010 | Views : 6158 | Status : [Member] | Replies : 4
Hi,
in my application when i enter inside a text box, i want to open another page.
means on textchanged event.how it is possible

Regards
K L BAIJU




Responses

Posted by: Vuyiswamb on: 8/4/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Textchanged event is fired when the textbox loses focus , if that is what you want to can to the

Response.redirect("mypage.aspx",false);


on that event.

Thank you for posting at Dotnetfunda
[Administrator]

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shankul2784 on: 8/4/2010 [Member] Bronze

Up
0
Down

If you want open by server side then you have to set the property autopostback = true & on textchanged event you can write the code.

Other wise you can write the code in onblur event of textbox using javascript.

I Hope, this will help you.


Thanks & Regards,

Shailesh

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhilan on: 8/4/2010 [Member] Starter

Up
0
Down
Client Side


<asp:TextBox id="Textbox" runat="server" onfocus="javascript:window.open('second.aspx');" />


Server Side

TextChanged Event

string str = "second.aspx";

ScriptManager.RegisterClientScriptBlock(this, GetType(), "window", "window.setTimeout(\"window.open('" + str + "')\",0);", true);


Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 8/6/2010 [Member] Bronze

Up
0
Down
Do you want to get the form opened at the Focus or at the Enter key hit.

If it is at the Focus we have to use the onFocu event else we can achieve this by key press event of the textbox.

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response