ASP.NET的Response.Redirect(Request.RawUrl)不工作 [英] ASP.NET Response.Redirect(Request.RawUrl) doesn't work

查看:172
本文介绍了ASP.NET的Response.Redirect(Request.RawUrl)不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只希望我的asp.net网页,改变我的组合框选定值后重装。所以,我没有

I just want my asp.net webpage to reload after changing my combobox selected value. So I did

    protected void MyComboBox_SelectedIndexChanged(object sender, EventArgs e)
    {
        Response.Redirect(Request.RawUrl);
    }

我根据所使用的Response.Redirect(Request.RawUrl)
<一href=\"http://stackoverflow.com/questions/1206507/how-to-refresh-the-page-in-asp-net-let-it-reload-itself-by-$c$c\">How刷新在ASP.NET页面? (让它由code自动重新加载)

但是,当我的组合页面更改选择不重新加载。

But when I change selection in my combo page is not reloaded.

为什么,怎么办呢?

推荐答案

请确保您已定义的控件本身的SelectedIndexChanged 事件。

Make sure you have defined the SelectedIndexChanged event on the control itself.

编辑:启用自动回上的控制,以及像安倍Miessler指出

Enable AutoPostback on the control as well, like Abe Miessler points out.

AutoPostBack="true"  
OnSelectedIndexChanged="MyComboBox_SelectedIndexChanged"

这篇关于ASP.NET的Response.Redirect(Request.RawUrl)不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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