单击下一步后,C#重定向(到同一页面) [英] C# redirect (to same page) on next button click

查看:321
本文介绍了单击下一步后,C#重定向(到同一页面)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我如何在不单击下一步的情况下将页面重定向到自身而不会丢失其值

Can anyone tell me how to redirect a page to itself without loosing its values on the click of next button

推荐答案

您可以保留会话值,页面的外观.单击下一个按钮时,将检查旧值,将会话设置为下一个"值,并同时更改UI.当您达到最后一个"值时,请显示摘要或重定向到其他页面.

希望这可以帮助.如果您明确指定了您的要求和先决条件,则可以提供更多信息.
You can keep a session value which will control the look and feel of your page. When the next button is clicked, you check the old value, set the session to "next" value and change the UI as well. When you reach the "last" value, either show a summary or redirect to some other page.

Hope this helps. More information can be provided if you specify your requirements and pre-requisites clearly.


如果先设置会话值,然后再设置response.redirect,则不会设置会话.设置会话后,您需要response.write一个javascript重定向.

If you set a session value and then response.redirect, the session will not set. You need to response.write a javascript redirect after setting the session.

Session("whatever") = "MyVal"

Response.Write("<script>window.location.href=''mypage.aspx?myQuerystringValue=" & Request.QueryString("myQuerystringValue") & "''</script>")


这篇关于单击下一步后,C#重定向(到同一页面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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