How to send values from one aspx page to another aspx page using "post method"
Solution:
Create a class named RemotePost.vb
and add the following code in that class
Imports Microsoft.VisualBasic Public Class RemotePost Private Inputs As System.Collections.Specialized.NameValueCollection = New System.Collections.Specialized.NameValueCollection Public Url As String = "" Public Method As String = "post" Public FormName As String = "form1" Public Sub Add(ByVal name As String, ByVal value As String) Inputs.Add(name, value) End Sub Public Sub Post() System.Web.HttpContext.Current.Response.Clear() System.Web.HttpContext.Current.Response.Write("") System.Web.HttpContext.Current.Response.Write(String.Format("", FormName)) System.Web.HttpContext.Current.Response.Write(String.Format("") System.Web.HttpContext.Current.Response.Write("") System.Web.HttpContext.Current.Response.End() End Sub End Class
now from any page from which u want to pass the value
use the following code
Dim myremotepost As RemotePost = New RemotePost myremotepost.Url = "targetURL.aspx" myremotepost.Add("param_name", "param_value") myremotepost.Post()for c sharp version mail me
info@amitech.co
www.amitech.co
No comments:
Post a Comment