webrequest read error (404 error)

Hi I need to send a value to a webpage and also fire the button on the page and get the result HTML codes.
Here is the page ; http://tckimlik.nvi.gov.tr/Web/VerifyIdentityNumber.aspx
When I enter the number 17275920520 and press the button , the page directs to itself with some values.
I need to send this number and get the whoole html results.

I have found some articles about reading and posting webrequests. Firstly I want to ask about the reading error.Here are the codes below for reading the source code of a web page (I know that after posting the value I will need to read the page source but I have detected as the page doesn't allow to be read .

<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>

<script runat="server" language="VB">

Sub Page_Load(sender as Object, e as EventArgs)
    'Create the HttpWebRequest object
        Dim req As HttpWebRequest = WebRequest.Create("http://tckimlik.nvi.gov.tr/Web/VerifyIdentityNumber.aspx")
      'Dim req As HttpWebRequest = WebRequest.Create("http://www.asp.net/getstarted/default.aspx?tabid=61")

     'Get the data as an HttpWebResponse object
     Dim resp as HttpWebResponse = req.GetResponse()

     'Convert the data into a string (assumes that you are requesting text)
     Dim sr as New StreamReader(resp.GetResponseStream())
     Dim results as String = sr.ReadToEnd()
     html.Text = results
    Catch wex as WebException
            Response.Write("<font color=red>HATA!<br />Status: " & wex.Status & "Message: " & wex.Message & "</font>")
    End Try
End Sub


<form id="Form1" runat=server>
    <asp:TextBox runat=server id="html" TextMode="MultiLine" Columns="60" Rows="15" />

I need to read the source code with the link http://tckimlik.nvi.gov.tr/Web/VerifyIdentityNumber.aspx .But I can read the http://www.asp.net/getstarted/default.aspx?tabid=61 link or any other link .
So what is the matter with the link that I want to read ?

11/14/2006 7:52:30 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 2


  I once tried to use HttpWebRequest with url "http://www.yahoo.com" and found it worked fine.The code is similar to yours.WebRequest error 404 means that remote server not found.Try to check the permissions in asp.net and IIS.

Try to google "HttpWebRequest Error 404" and get the solution to your problem.

11/14/2006 9:18:22 AM

Similar Artilces:

Error, Error and more errors
Okay, all I wanted to do was test this app out and it has been a nightmare. 1.) Didn't install the sql database. I had to manually install it. 2.) I get errors when trying to add a picture to an album. "Procedure or function ngUpdatePicture has too many arguments specified" Any ideas? I've gotten more errors than this, but there is no use in bitchin. Are you using the v1.6.1 installer? Also, did you select to install the SQL Server db and give it a valid admin login? What were some of the error messages? Did you have an existing DB from a previous install? ...

error error error
These are the 2 new errors i am getting now:   1).  Server Error in '/' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.Source Error: Line 53: ...

errors errors errors..
Name: harun Email: harunbjk1903hrnatgmaildotcom Product: Firefox Summary: errors errors errors.. Comments: first of all when i launch firefox (3) i cant enter websites via writing.. for example when I type "google" and then press ctrl and enter, it crashes.. and i take lots of error reports. firefox 2 was better.. see you again , harun Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9) Gecko/2008052906 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

Error error error, help me
Hello, How do I populate a drop down list in asp.net from a database? I have a block of vbscript code that does the server side coding for it. My code is as follows.. <script language="vb" runat="server"> Dim objConn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\data\employee.mdb;") Dim Sql, valEmp As String Dim objDREmp as OleDbDataReader Sub FillEmployeeName(sender As Object, e As System.EventArgs) Sql = "select * from [Employee]" Dim objCommand As Ole...

Error or not error?
Hi gurus, hope you can help me with this problem: OS: Solaris 7 ASE: 12.5 I recently got some strange error messages when doing dbcc tablealloc with fix: *************************************************************** TABLE: hence_meaning OBJID = 100192376 INDID=0 FIRST=1817 ROOT=401935 SORT=0 INDID=2 FIRST=2882 ROOT=2881 SORT=1 Table Corrupt: Attempted to get page 330126, object 100192376; got page 0, object 0. Table Corrupt: Attempted to get page 272316, object 100192376; got page 0, object 0. Table Corrupt: Attempted to get page 322961, object 100192376; got p...

error after error
Hello, All I seem to be getting an error I don't quite understand. Can someone point out why I'm geeting this error? The first error states: unquoted string "subroutines" may clash with future reserved word at NPtest.pl line 6. after I quote "subroutines" I get an error that states: syntax error at NPtest.pl line 6, near "require" Execution of NPtest.pl aborted due to compilation errors. Heres the first script: #!/usr/bin/perl # NEWPACKAGE.pl package NEWPACKAGE sub printing1 {print "duh duh duh.\n&quo...

error error !
Full Message: ERROR{} Additional Information: None Severity: Error Date: November 14, 2007 11:42:35 AM Acknowledged Date: None Source: /Devices/Workstations/b2305dsyldes-58 Message ID: ERROR Probable Cause URL: None Log ID: ac4f2a9dbea6435421f4d9f92db8e971 Related Objects: None What does this means ? Marc-Andre, no idea, maybe a little more background information would help? -- Shaun Pond well, nothing special to say, some DLU policy, 1 remote policy, that's about it.......... Shaun Pond wrote: > Marc-Andre, > > no idea, maybe a little m...

visual studio not giving compile errors even if there are errors in a web form
Hi , I am having problems with my visual studio 2005 product. This is my configuration. Visual studio 2005 Professional Edition on windows vista computer. I have a web site project and some other class projects referenced in the web site. Let's say if I change a function name in the class library and if that function is used in several web forms, when I compile the solution I am not getting any errors. Now when I access that page, it gives an error in the browser. I set up the web site project to compile each web form into its separate dll. so I am thinking when I rebuild the solution...

404 Error Script Error
Hello, I want to redirect clients to a different web page when they get a 404 error. I'm not sure how to configure Dynamo to do the redirection. RK In the autoexec.ssc under the PD site/system directory script add the following line site.OnEvent('','Status404','','','notfound.htm'); where notfound.htm is your error display page. HTH -Aditya RK <blank@blank.net> wrote in message news:01bef572$62695660$51fa320a@OOMC... | Hello, | | I want to redirect clients to a different web page when they get a 404 | error. I...

Error reading from socket error
Hi there, We're using socket server 3-tier for many years. There are 4 application servers(win2000 server), for each up to 500 connections. While error reading from socket raised, we needed to restart socket server or even win2000 server. The socket server version is with multi cpu bug fixed. Any ideas? Thank you ...

Strange VS.NET Web Form Designer Error
Suddenly I get an error while loading a web form into VS.NET 2002: The file failed to load in the Web Form Designer. Please correct the following error, then load it again: Type Abstract. Then the "aspx.vb" page opens and the aspx page in HTML mode. The page derives from another page containing some common procedures. This base page has no controls and can be opened in the Designer. But I used this technique before and had no problemsuntil now. What means "Type Abstract" in this context ? Why are there no web Form Designer Error explainations in the Help ? ...

error trying to create web form from visual studio.net
I get the following message when I try to create a web form from visual studio. Visual Studio.NET has detected that the specified web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET web applications or services. I downloaded and installed ASP.NET version 1.1. Why am I getting this message? Thanks, Keith Stallings Try running aspnet_regiis -i from the .Net Framework's bin directory to see if it corrects the problem....

Avoiding nasty-looking .Net errors with bad urls, error handling in web.config and global.aspx.vb
It's quite easy to generate nasty looking errors in DNN by eg entering &tabid=rubbish on the url or asking for a file that doesn't exist. Firstly, I'd recommend a custom error page (though not sure what should be in it) and note that you can specify a special page eg for 404 - page not found, which you could make redirect to root, or in my case, I look for page in portal upload directory then redirect to &tabname=404 to allow per-portal custom 404 pages. &lt;customErrors mode="RemoteOnly" defaultRedirect="/error.htm" > &lt;error st...

Web Service Error : The remote server returned an error: (500) Internal Server Error
Hi i am getting an error when trying a simple web service. if i run both the web service and the client .aspx page on the same server it works fine, But when i put it on a different server it doesnt work at all and gives me this error"System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at HttpUtils.HttpPost(String URI, String Parameters) in e:\Websites\C#\Live\CMS\Trunk\App_Code\siteFunctions\HttpUtils.cs:line 35"UserApi.asmx  [WebMethod] public string HelloName(string name) { ...

Web resources about - webrequest read error (404 error) - asp.net.web-forms

Issue 122548 - chromium - Chrome displays insecure content warnings for content handled by the WebRequest ...
jered@chromium.org , battre@chromium.org , tsepez@chromium.org , mpcomplete@chromium.org , ga...@chromium.org , Sriharir...@chromium.org , j ...

Newest 'google-chrome-devtools' Questions - Stack Overflow
Q&A for professional and enthusiast programmers

Contacts - Northern Territory Government
This page contains department contact information for the Northern Terrritory Goverenment

Command Line Client for Google Reader in IronPython
A few days ago I blogged about my plans to make RSS Bandit a desktop client for Google Reader. As part of that process I needed to verify that ...

Enable “Do Not Track” in Google Chrome
A small extension for Google Chrome, which brings support for Do Not Track, and hence enhances online privacy.

Languages -> C# Articles, Tutorials, Examples: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Sample Extensions - Google Chrome
Skip to main content Devtools Learn Basics Overview Development Workflow Using the Console Tips & Tricks Additional Resources Videos Blog Posts ...

Speed Up Google Plus By Loading WebP Images on Chrome
Speed Up Google Plus By Loading WebP Images on Chrome. Use the chrome.declarativeWebRequest API to intercept, block, or modify requests in-flight. ...

Application Analytics
Mighty Moose is nearing release. One of the new items that we have built into it is some user tracking. The user tracking is extremely benign ...

digg API.NET - C# Implementation of digg Web Services - CodeProject
A C# Library Interface For the Digg.com API; Author: thund3rstruck; Updated: 5 Oct 2007; Section: C#; Chapter: Languages; Updated: 5 Oct 2007 ...

Resources last updated: 11/30/2015 8:00:50 AM