How to display posted XML data in ASP.Net - asp.net

I am trying to setup a test page that will display an XML Post from a gateway but can not find any examples of how to do this. Every example I have seen has been posting information FROM a page or reading an XML FILE but nothing relating to dispalying a (I think its called) xml stream that is posted to a page?
The idea is this: User submits a form. Form is posted to gateway. Gateway responds with success/failure and error messages (in the form of xml) to my dev page. Dev page displays the XML.
Anyone have any suggestions?

if it's for development purpose, you could use the firebug plug-in for Firefox instead of having the "Dev page displays the XML"
http://getfirebug.com/

Related

IIS / ASP.NET MVC gives error when adding query strings to URL

We run an ASP.NET MVC website (let's say www.domain.com), on IIS.
When adding a random query-string to the URL, let's say www.domain.com?abcdefg, the code yields an error page and changes the URL into something like www.domain.com/nl/nl?abcdefg
I am asking this, because when people share our site www.domain.com on Facebook or elsewhere, it goes wrong. Although Facebook successfully fetches the OpenGraph meta data (such as page title, opengraph image, etcetera) and displays a neat 'snippet (preview)', if you click on the snippet you're being redirected to an error page generated by code.
Does anyone know how to prevend this?
(as background info: the normal URLs are built up like www.domain.com/nl/..... and they work fine)

external POST request to update on aspx page

I am working in .net webforms and am submitting something to an external web service via .ashx which then returns a POST request with parameters to my .aspx page. I am having trouble figuring out how to get that data back on my page.
I understand that Request.QueryString["parameterName"] should get anything sent as a querystring, but how can I then take that information and, say, put it in a label on the page in my browser.
Basically I want this: user is on .aspx page, clicks a button, processing happens externally and information from the POST request from the webservice is then displayed on the screen for the user on the same .aspx page.
I assume this involves and needs some ajax - I just am not quite comfortable enough with it to know how to do it and if what I am doing is right.
Any help would be much appreciated!
thank you in advance,
syd

Why one can't download the web page of a tweet through an "http-get" request?

Through a web browser, I can view the tweet page via visiting an url like
http://twitter.com/#!/[user-name]/status/[long-integer]
but I can't get the correct page content through the unix command "wget". Instead, I get the welcome page of Twitter.com. How does Twitter.com distinguish a command line "get" request and a request through a browser? Thank you.
While I am trying to find the cause of the problem, someone else is trying to find the solution to the problem. => Navigating / scraping hashbang links with javascript (phantomjs)
Because use "hash URIs" is a stupid idea and only works in Javascript-enabled devices.
http://www.jenitennison.com/blog/node/154

How do I debug step into an ASPX page that requires an XML request?

Is there a way to test sending an XML file as a request to my ASP.Net web page within Visual Studio 2008?
Ok, no one has answered this in a helpful way. I have a situation where I have an ASPX page that I send an XML file too and receive an XML response from. In order to debug this, I need to step into the page while providing an XML request. I This is what I need to figure out how to do?
This is easy. Just create an HTML page that contains a simple submit form, and it's submit action will post-back the XML. In visual studio, all you have to do is attach to process-> and choose the browser window containing your HTML form, and there you go.
You can simply put a breakpoint at the code behind just before sending the file to see that everything at that point is as expected.
From then on, the best way to see what goes over the wire is to use a debugging proxy like fiddler.
Alternatively, there is firebug and its Net tab which will show your requests and responses.

ASP.NET - Send Information to Website

I have an asp.net webpage that only contains a textbox and a button. The user submits their email address using this webpage.
What I am trying to do now is take the information submitted by the user and go to another website. Where my "website/program" gives the different website the entered email address, and clicks the submit button.
If I where to physically go to the different website, there would be a textbox to enter the email. But since I am accessing the website from my page "behind the scenes" I cant manually enter their email address...
Is it possible to do this, if so how? Also, my code behind is in VB.
Thanks!
Well it can be done, but the simpllicity of it depends on what this other webpage is. Will this webpage always be the same or can it change?
If it a dynamic website that will frequently change, then you will need to basically parse the html and emulate how the email address gets posted to the webpage. Look for the tag in the html and see what page it posts to.
What you want to do is use HttpWebRequest. This class can send information to another web page. Here is a tutorial on how to do what you are asking: http://www.jigar.net/howdoi/viewhtmlcontent106.aspx
And here is the MSDN documentation on it: http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(VS.71).aspx
Keep in mind that my solution will work if the web site is using POST or GET, but some sites use Javascript. To do this, it will require you to build a javascript interpreter.

Resources