我在查询sting上传递字符串id以获取所有值但该值未传递 [英] i am passing string id on query sting to get all values but that value not passed

查看:71
本文介绍了我在查询sting上传递字符串id以获取所有值但该值未传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用regno作为字符串现在我传递并获取给定的查询字符串....但是未传递的值....

i have using regno as string now i pass to and get on that query string given....but the value not passed....

http://localhost:4624/administration/Services/ServiceMemberCallLogProcess.aspx?Regno=%3C%Eval%28%22Regno%22%29%20%%3E

.if我通过任何regno上面的url只是来了。会发生什么?



.if i passed any regno the above url only came.what happen?

public string Regno
        {
            get
            {
                return CommonHelper.QueryString("Regno");

            }
        }
           }

推荐答案

嗨venkivenkatesan,



看起来你绑定了值
Hi venkivenkatesan,

Looks like your binding the value
<%Eval("Regno" )%>

。由于语法不正确,编译器将其解释为静态值而不是动态值。



在这种情况下有一个缺少#部分,导致问题。



试试这个一个而不是你的:



to the querystring value. AS the syntax is incorrect, the compliler is interpreting it as a static value instead of a dynamic value.

There is a missing # part in that scenario, which is causing the issue.

Try this one instead of yours:

<%# Eval("Regno" )%>







谢谢,

Vamsi




Thank you,
Vamsi


如果你在客户端生成查询字符串(通过javascript)

使用:
if you generate query string in client ( via javascript)
use:
function escape()



如果在服务器中生成查询字符串(通过.NET语言)

使用:


if you generate query string in server ( via .NET languages)
use:

function eval()



永远不会自己生成查询字符串!!


never generate query string by yourself !!


这篇关于我在查询sting上传递字符串id以获取所有值但该值未传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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