重定向到保留数据的同一页面 [英] Redirecting to same page with data retained

查看:79
本文介绍了重定向到保留数据的同一页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我有一个基本表单页面,其中包含Id,name等字段...只要输入Id,页面就应该重定向到同一页面传递参数。一旦控件离开Id texbox,我会怎么做才能重定向页面,这里不会按任何按钮。

I have a basic form page with fields like Id, name...As soon as i enter Id, page should be redirected to same page passing the parameter. what event or what should i do to redirect a page as soon as control leaves Id texbox, no button will be pressed here.

推荐答案

Sara,

你有很多选择来实现它。您可以选择任何一个简单选项。

You have many option to achive it. You can choose any one of the simple option.

Option1

您可以使用Asp.net的TextChanged事件文本框。

You can use TextChanged event of Asp.net Textbox for that.


 protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        Response.Redirect("Page2.aspx?id=" + TextBox1.Text);
    }


这篇关于重定向到保留数据的同一页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆