asp.net查询字符串 [英] asp.net query string

查看:114
本文介绍了asp.net查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用查询字符串将ItemsID从一个页面发送到另一个页面。



首页: - 用于发送ID的查询字符串: -



I am using Query String For Sending ItemsID from one page to another page.

First Page :- Query String For Sending ID :-

<asp:LinkButton ID="lnkbtnGetDetails" runat="server" Text="Details" PostBackUrl='<%#"ItemsDescriptionDetails.aspx?ItemsID="+Eval("Prod_Sub_Cat_Items_Desc_ID") %>' >







第二页:使用查询字符串ID






Second Page : Using Query String ID

int id;

protectd void Page_Load(object sender, EventArgs e)
{
 if (Request.QueryString["ItemsID"] != null)
      
  { 
        id = Convert.ToInt32(Request.QueryString["ItemsID"]);
        FetchItemsDescription(); // Method Name for fetching records using query string ID
        }
        else
        {
        Response.Redirect("Home.aspx");
        }
}







当我浏览第一页时使用查询字符串到第二页然后使用查询字符串我在seond页面显示数据......但是当我点击第二页上的后退按钮....然后它没有重定向到第一页它显示一些错误喜欢(确认表格重新提交

此网页需要您之前输入的数据才能正确显示。您可以再次发送此数据,但这样您将重复此页面之前执行的任何操作。重新加载以重新发送该数据并显示此页面。)





Pl''z建议我,我该如何解决它... ..........




Using query string when i am navigating first page to second page then using query string i display data in seond page......but when i am clicking back button on second page....then it''s not redirecting to first page it''s showing some error like (Confirm Form Resubmission
This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed. Press Reload to resend that data and display this page.)


Pl''z suggest me, how can i solve it.............

推荐答案

如果你正在使用链接按钮然后使用



if u are using link button then use

<asp:LinkButton ID="submit" runat="server" Text="Submit" OnClientClick="javascript:transfer('<%=Jobid%>')"></asp:LinkButton>


<script language="javascript">
function transfer(opt)
{
window.open("/pagename.aspx?jobid="+opt,'Title','width=200,height=100')
}
</script>







将值从一个页面发送到另一个页面的其他方式。 />


将页面值传输到另一页 [ ^ ]


我认为您尝试使用其他浏览器,因为您的代码是正确的,并且您的数据也会在下一页显示良好,

删除您在该页面中使用的其他java脚本,因为它也是resion错误。
i think you try another browser for this, because your code is right, and your data is also display well in next page,
remove other java script which you use in that page, because it also resion of error.


这篇关于asp.net查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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