将变量插入查询字符串<%#= address%>。 [英] Insert a variable into a querystring <%#=address%>.

查看:117
本文介绍了将变量插入查询字符串<%#= address%>。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想插入<%#= address%>。你如何在ASP.net中做到这一点我知道如何在PHP中做到这一点:



I want to insert in <%#=address%>. How do you do this in ASP.net I know how to do it in php:

<img src="http://maps.googleapis.com/maps/api/staticmap?center=<%#=address%>&zoom=13&size=600x600&maptype=roadmap&sensor=true" alt="Home" />

推荐答案

您可以尝试如下所示。



注意:这只是一个示例。请根据您的应用进行调整。



1。重定向到包含查询字符串的位置:



You may try as shown below.

Note: This is just a sample.Please Adjust it according to your app.

1. Redirect to a location with a query string :

Response.Redirect("YourPage.aspx?id=" + yourId.toString(), true);





2。将按钮渲染为LinkBut​​ton并设置URL:





2. Render the button as a LinkButton and set the URL :

LinkButton myLinkButton = new LinkButton("YourPage.aspx?id=" + yourId.toString(), true);





3。将按钮渲染为客户端链接(使用Repeater控件)



3. Render the button as a client side link (with Repeater control)

<a href='YourPage.aspx?id=<%# Eval("yourID") %>'>Link</a>


这篇关于将变量插入查询字符串&lt;%#= address%&gt;。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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