在ASP.NET C#表单中获取和发布参数

编程入门 行业动态 更新时间:2024-10-12 18:15:34
本文介绍了在ASP.NET C#表单中获取和发布参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我从网址获取名为'auth_token'的参数,需要将其发回给另一个网址。 < form action =easypay.easypaisa.pk/easypay/Confirm.jsfmethod =POSTtarget =_ blank > < input name =auth_tokenvalue =hidden =true/> < input name =postBackURLvalue =http ://www.my.online-store/transaction/MessageHandler1hidden =true/> < input value =confirmtype =submitname =pay /> < / form> 代码确实获取并传递参数,因为它适用于php。在这方面有谁能帮助我。 我尝试过: 我尝试了不同的方法来获取并传递参数但没有任何效果。

解决方案

检查此代码可能对您有用 无效Page_Load(){ string auth_token = Request.QueryString(auth_token); string postForm =< center style ='font-family:Verdana; font-size:13px; margin-top:200px;'>< p> Please等待,传输数据....< / p>< / center> + < form action ='http://www.my.online-store/transaction/MessageHandler1'methation ='post'ID ='Form1'name ='Form1'> ; < input type ='hidden'name ='auth_token'value ='+ auth_token +'ID ='auth_token'> + < / form>< script> document.Form1.submit();< / script>; Response.Clear(); Response.Write(postForm); Response.Flush(); Response.End(); }

Hi, I am getting parameter named 'auth_token' from a url and need to post it back to another url. <form action=" easypay.easypaisa.pk/easypay/Confirm.jsf " method="POST" target="_blank"> <input name="auth_token" value="" hidden = "true"/> <input name="postBackURL" value=" www.my.online-store/transaction/MessageHandler1" hidden ="true"/> <input value="confirm" type = "submit" name= "pay"/> </form> The code does get and pass the parameter because it is for php. Can anyone help me in this regard. What I have tried: I tried different ways to get and pass the parameter but nothing work.

解决方案

Check this code may be useful to you Void Page_Load(){ string auth_token = Request.QueryString("auth_token"); string postForm = "<center style='font-family:Verdana; font-size:13px; margin-top:200px;'><p>Please Wait, Transferring data….</p></center>" + "<form action='www.my.online-store/transaction/MessageHandler1' method='post' ID='Form1' name='Form1'>" "<input type='hidden' name='auth_token' value='" + auth_token + "' ID='auth_token'>" + "</form><script>document.Form1.submit();</script> "; Response.Clear(); Response.Write(postForm); Response.Flush(); Response.End(); }

更多推荐

在ASP.NET C#表单中获取和发布参数

本文发布于:2023-06-11 00:12:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/621997.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   参数   ASP   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!