带有INPUT控件的POST表单,其值作为XML字符串 [英] POSTing form with INPUT controls with value as XML string
问题描述
在我的应用程序中,我需要将Inventory.aspx形式发布到名为proxy.aspx的页面上.
Inventory.aspx有一个隐藏按钮,其POSTBACKURL已更新为proxy.aspx.
在客户端,通过javascript执行隐藏按钮的点击
Hi,
In my application I need to POST the form Inventory.aspx to a page called proxy.aspx.
Inventory.aspx has a hidden button whose POSTBACKURL is updated as proxy.aspx.
At the clientside, through javascript the click on the the hidden button is executed
document.getElementById("hidBTN").click();
我发现所有作品都可以找到该表单已发布到proxy.aspx.
Inventory.aspx没有控件,而以下是控件之一
All works find I can find that form is posted to proxy.aspx.
Inventory.aspx has no of controls and one of those is the following
<input id="ReportXML" type="hidden" name="hiddenXML" runat="server" value="" />
如果此输入变量的值更新为
If the value of this input variable is updated as
$get(''ReportXML'').value = "<newdataset></newdataset>";
我的表格根本不发布.
因此,我更改了<通过& l t;和>作为&吨然后我的表单就会发布,但随后在代理页面上,我需要替换&吨与<和&吨通过>然后解析xml.我不喜欢这种方法.
我可以使用控件的值是xml字符串的表单来发布表单,而不必替换<吗?和>符号.请注意,我还需要发布其他控件,这些控件的值也不是XML字符串?
有人可以指导吗?如果我可以通过单击其POSTBACK URL被指定为代理的按钮来保持POSTING,那就更好了.
my form does not post at all.
So I change the value of < by &l t ; and > as & g t ; then my form posts but then at the proxy page I need to replace the & l t ; with < and & g t ; by > and then parse through the xml. I don''t like this approach.
Can I post my form with the control whose value is of xml string without replacing the < and > symbols. Note that I need to post other controls also whose values are not XML strings?
Could anybody guide in this? It would be better if I can keep the POSTING by clicking of the button whose POSTBACK url is given as proxy.
Thanks.
推荐答案
get(``ReportXML'').value =< newdataset></newdataset>";
get(''ReportXML'').value = "<newdataset></newdataset>";
我的表格根本不发布.
因此,我更改了<通过& l t;和>作为&吨然后我的表单就会发布,但随后在代理页面上,我需要替换&吨与<和&吨通过>然后解析xml.我不喜欢这种方法.
我可以使用控件的值是xml字符串的表单来发布表单,而不必替换<吗?和>符号.请注意,我还需要发布其他控件,这些控件的值也不是XML字符串?
有人可以指导吗?如果我可以通过单击其POSTBACK URL被指定为代理的按钮来保持POSTING,那就更好了.
谢谢.
my form does not post at all.
So I change the value of < by &l t ; and > as & g t ; then my form posts but then at the proxy page I need to replace the & l t ; with < and & g t ; by > and then parse through the xml. I don''t like this approach.
Can I post my form with the control whose value is of xml string without replacing the < and > symbols. Note that I need to post other controls also whose values are not XML strings?
Could anybody guide in this? It would be better if I can keep the POSTING by clicking of the button whose POSTBACK url is given as proxy.
Thanks.
查看 HttpServerUtility类 [ ^ ]特别是HtmlEncode
和HtmlDecode
方法
Check out the HttpServerUtility Class[^] specifically theHtmlEncode
andHtmlDecode
methods
这篇关于带有INPUT控件的POST表单,其值作为XML字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!