张贴到当前页面,保持查询字符串值圆通 [英] Post to current page, keeping querystring values in tact
问题描述
我有我想创建一个下拉列表,并张贴回,我现在就在同一个页面一个页面。
I have a page that I want to create a drop down list, and post back to the same page that I am on now.
我怎样才能做到这一点?
How can I do this?
一个美中不足的是,我希望所有的查询字符串值是也一样,除1这是什么下拉列表将被覆盖。
One catch is, I want all the querystring values to be the same also, except for 1 which is what the drop down list will be overriding.
推荐答案
您可以在同一页面中,如果你想同时使用查询字符串和表单变量。如果你使用<形式方法=邮报>
并保留采取行动空,它发布的形式返回到当前页面,所以这是解决的一个问题。有一点需要注意:我不知道,如果离开空行动将保留查询字符串参数完好与否。
You can use both querystring and form variables in the same page if you want. If you use <form method="post">
and leave the action empty, it will post the form back to the current page, so that's one problem solved. There is one caveat: I'm not sure if leaving the action empty will keep the querystring parameters intact or not.
如果没有,你可以尝试这样的事:&LT;形式方法=邮报行动=?的index.asp&LT;%=的Request.QueryString%GT;&GT;
(不知道确切的语法,要旨是,你将需要指定当前页面,并在方法中添加当前查询字符串变量)。
If not, you can try something like this: <form method="post" action="index.asp?<%= request.querystring %>">
(not sure about the exact syntax, the gist is that you will need to specify the current page and add the current querystring variables in the method).
在发布可以选中这两个和的Request.Form后的Request.QueryString页面上的ASP code。的Request.Form将包含表单提交的变量。的Request.QueryString将包含后面的变量?在您的网址。
In the ASP code on your page after posting you can check both request.form and request.querystring. request.form will contain your form post variables. request.querystring will contain the variables behind the ? in your URL.
HTH,
埃里克
HTH, Erik
这篇关于张贴到当前页面,保持查询字符串值圆通的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!