[RESOLVED] redirect on etxtbox text change

how to response.redirect on textbox etxt change event to another page.


use following code

<asp:Textbox runat="server" id="btnTest" onkeypress="javascript:window.open('newpage.aspx', '_self');">

protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        string url = "yourpagename";//default.aspx;
        Response.Redirect(url);
        //or
        Server.Transfer(url);
    }



i have a autocomplete.when i select anyvalue from the autocomplete list..it appers on the textbox now this it the time when i want to response.redirect.r u getng the point?


aha even if u have an AutoComplete-Box try to Redirect on Click on Button..

protected void Button2_Click(object sender, EventArgs e)
    {
        TransValue(TextBox1.Text);
    }


    private void TransValue(string p)
    {
        if (p != null)
        {
            string url = "yourpagename?";//default.aspx;
            url += "MyValue=" + Server.UrlDecode(p);
            Response.Redirect(url);
            

        }
     

    }


yes id did that. but i want on etxtchange also.

Hi ogsim07, 

If you use the jquery autocomplete, you can set the  selectItem for the control.

And use the window.open to open a new window.

Please check the following link:

http://www.pengoworks.com/workshop/jquery/autocomplete.htm

If you use autocomplete toolkit toolkit, you use the sys.application to append the selectitem event for it.

And register the javascript for it.

 

thoughts on "[RESOLVED] redirect on etxtbox text change"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>