<%@ Page Language="C#" CodeFile="~/listen.aspx.cs" Inherits="listenerTest.listen" %>
<%
Response.ClearContent();
Response.ClearHeaders();
Response.Clear();
Response.AddHeader("Content-Type", "text/plain");
if (Request.Form.Count != 0)
{
string all = "";
foreach (string name in Request.Form.AllKeys)
{
string value = Request.Form[name];
// Do something with (name, value).
all += "key:" + name + "value:" + value;
}
}
Response.End();
%>
A blog about web application development mainly on backend side
Thursday, January 17, 2013
Retrieving all values from POST in asp.net
Here is the code:
Thursday, January 3, 2013
Simple Form post from Codebehind C#
Here is the sample code:
private void PostToUrl(string url, string parameters)
{
string URI = url;
string myParameters = parameters;//"param1=value1¶m2=value2¶m3=value3";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
string HtmlResult = wc.UploadString(URI, myParameters);
}
}
Select an element from xml file using where clause
Here is the sample xml file
Here is the sample code
<?xml version="1.0" encoding="utf-8" ?>
<urls>
<url keyword="RA">http://google.com </url>
<url keyword="NC">http://google.com </url>
</urls>
Here is the sample code
XDocument doc=XDocument.Load(Server.MapPath("~/urllist.xml"));
var url = (from ur in doc.Descendants("url")
where ur.Attribute("keyword").Value=="RA"
select ur.Value).ToList();
Subscribe to:
Posts (Atom)
What is DaemonSet in Kubernetes
A DaemonSet is a type of controller object that ensures that a specific pod runs on each node in the cluster. DaemonSets are useful for dep...
-
Cross-platform compatibility: MAUI allows developers to write code that can run on multiple platforms with minimal modifications. Shared cod...
-
Both .NET and NodeJS are popular programming frameworks that have their own strengths and weaknesses, which makes for an interesting compar...
-
A DaemonSet is a type of controller object that ensures that a specific pod runs on each node in the cluster. DaemonSets are useful for dep...