如何使用&传递字符串操作员.. [英] How to pass a string with & operator..

查看:80
本文介绍了如何使用&传递字符串操作员..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库中有类似newyork& steert1的值...我需要将此字符串传递给另一个页面...

I have values like newyork&steert1...in my database i need to pass this string to another page...

 

我像路过

string strddl = DropDownList1.SelectedValue.ToString();
     
       Response.Redirect("city.aspx?id =" + strddl);

string strddl = DropDownList1.SelectedValue.ToString();
      
        Response.Redirect("city.aspx?id=" + strddl);

 

但是这些值不会传递到下一页.

but these values are not passing to next page..

我认为该字符串不作为一个字符串...

I think the string is not taking as one string ...

任何人都可以建议如何传递此字符串...

can any body suggest how to pass this string...

推荐答案

Hi
  即使您使用HttpUtility.Encode/Decode,也会出现&"在文本中签名.我建议您将值放在一个隐藏的字段中,然后从Request对象的下一页访问它.您也可以使用会话.

Hi
   Even if you use HttpUtility.Encode/Decode, there will be an "&" sign in the text. I would suggest you to put the value in a hidden filed and access it in the next page from the Request object. You can use session also for the same.


这篇关于如何使用&传递字符串操作员..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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