如何处理URL中传递的参数中的空格,或者如何去除URL中传递的参数中的引号 [英] How to deal with spaces in parameters passed in URL, or, how to get rid of Quotation marks in parameters passed in URL

查看:103
本文介绍了如何处理URL中传递的参数中的空格,或者如何去除URL中传递的参数中的引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将参数传递给newform.aspx以预填充某些字段

Im passing parameters to a newform.aspx in order to prepopulate some fields

例如https://< site> Lists / Course%20feedback / NewForm.aspx? CourseTitle =" Advanced Word 2016& CourseDate =" 16 May 2019"

eg https://<site>Lists/Course%20feedback/NewForm.aspx?CourseTitle="Advanced Word 2016"&CourseDate="16 May 2019"

该网址是在                ;从该列表中,它们中都有空格。 

The URL is being generated in a SPD 2013 workflow attached to another list, using existing fields from that list, and they have spaces in them. 

在NewForm.aspx中,我将它们分配给参数(源查询字符串),然后将它们传递给标签

In NewForm.aspx I am assigning them to parameters (source Query String) and then passing them to a label

例如 < asp:Label runat =" server" text =" {$ TrainerParam}">< / asp:Label>

eg <asp:Label runat="server" text="{$TrainerParam}"></asp:Label>

参数当然会在带有引号的表单上显示。

The parameters of course appear on the form with the quotation marks.

关于删除它们的最佳方法的任何想法?

Any ideas on the best way of removing them?

谢谢。

推荐答案

尝试对URL进行编码。

Try to encode the URL.

https://www.ascii.cl/url-encoding.htm

NewForm.aspx?CourseTitle%3DAdvanced + Word + 2016%26CourseDate%3D16 + May + 2019

NewForm.aspx?CourseTitle%3DAdvanced+Word+2016%26CourseDate%3D16+May+2019


这篇关于如何处理URL中传递的参数中的空格,或者如何去除URL中传递的参数中的引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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