Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created webpage in asp.net.
When I open page in google crom it through following error on webpage.

This page contains the following errors:
error on line 46 at column 54: Namespace prefix asp on TextBox is not defined
error on line 60 at column 58: Namespace prefix asp on Button is not defined
Below is a rendering of the page up to the first error.
Posted
Comments
Prasad_Kulkarni 5-Mar-12 6:32am    
can u post you code
Anuja Pawar Indore 5-Mar-12 7:14am    
Post your code to get the right help

try this
For button
C#
<asp:Button ID="Button1" runat="server" Text="Button" />

For Textbox
C#
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
 
Share this answer
 
v3
Comments
dcba1 5-Mar-12 7:29am    
This is my code
I have declared it by same code as u told.
But its not working
<table style="border: thin double #0B2161; width: 100%; height: 83px;"
frame="border">
<tr>
<td>
 User name
 
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server">
</td>
</tr>
<tr>
<td>
  Password</td>
<td>
<asp:TextBox ID="TextBox2" runat="server">
</td>
</tr>
<tr>
<td>
  </td>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" />
</td>
</tr>
</table>
Sergey Alexandrovich Kryukov 5-Mar-12 18:41pm    
I think I can guess what happens. Please see my answer.

Probably OP does development with Visual Studio. During debugging, it runs on the special development HTTP server. The she/he tried to run it with Chrome and... loaded .aspx file. No wonder it would not work, just because this is not valid HTML. OP should have loaded the page via http://localhost:[port#]...

--SA
to.areeb 7-Mar-12 0:34am    
If you want to check in chrome then right click to page in visual studio >> click on Browse with >> select browser you want to browse it.
It looks like you try to open the source code .aspx page in the browser. You cannot do it; it makes no sense. You need to access this page through ASP.NET-enabled HTTP server.

ASP.NET is server-side technology. If you don't understand it, I would now know what are you developing; probably nothing.

You can do two things:

1) Run your Web application through Visual Studio. Look at your URL at the development HTTP server. It should look like "http://localhost:[port#]..." or have local IP address instead of "localhost". Open the same UTL in Chrome.

2) Run your Web application. In the Web browser, use "View Page Source" or "Save Page As". Save the page locally. It will be in the form seeing by a Web browser. Open it with Chrome and test, but all dynamic functionality would not work, of course.

But first of all, please get full understanding on how HTTP works, what server and client side do, etc.

—SA
 
Share this answer
 
v2
Comments
dcba1 6-Mar-12 1:29am    
No. I tried to open it in Google Chrome. Because i want to see it will run on all browsers or not.I am developing that site on visual studio 2008.
Sergey Alexandrovich Kryukov 6-Mar-12 1:51am    
What exactly "no"? Tried to open what? HTTP URL or .aspx file? If .aspx file, it makes no sense.
I told you what do you need top open to see it.
--SA
Sergey Alexandrovich Kryukov 6-Mar-12 14:24pm    
Sure, this is one more way to see it in a right way. Please see my new comment below, it explains why I suspect OP viewed the page with Chrome in a wrong way.
--SA
dcba1 6-Mar-12 2:45am    
http url
Sergey Alexandrovich Kryukov 6-Mar-12 14:23pm    
Are you sure? You error message says about namespace prefix "asp". This namespace prefix is never generated in HTTP response and should never appear in your client side. That's why I suspected you did not run it through server.

OK, could you post the HTML page as it comes to the client side, running your application, using "view page source" and saving it as a file? Use "Improve question" to add this code.

--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900