.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

asp.net avoid navigation on enter key

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
How can i avoid navigation when a user presses the enter key on an asp.net page ? Seems that they get redirected to the first page in the directory structure "Account\AccountRcovery" I don't actually have any code to redirect to that page. Also can this be disabled for the entire site ? as i have quite a few pages that would require modifications otherwise. This seems to only affect IE ,doesn't happens in Firefox. This is the content for an empty page, where this thing still hapens.<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Wip.test" %> <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> </asp:Content> 0 down vote favorite How can i avoid navigation when a user presses the enter key on an asp.net page ? Seems that they get redirected to the first page in the directory structure "Account\AccountRcovery" I don't actually have any code to redirect to that page. Also can this be disabled for the entire site ? as i have

View Complete Post

More Related Resource Links

Top .NET Performance Problems and how to avoid them

Every time I work with one of our .NET customers to help them with managing their application performance I come across the same problems as seen with other clients before: lots of ADO.NET queries, many hidden exceptions in core or 3rd party .NET libraries, slow 3rd party components, inefficient custom code

How to detect and avoid memory and resources leaks in .NET application

Despite what a lot of people believe, it's easy to introduce memory and resources leaks in .NET applications. The Garbage Collector, or GC for close friends, is not a magician who would completely relieve you from taking care of your memory and resources consumption.

I'll explain in this article why memory leaks exist in .NET and how to avoid them. Don't worry, I won't focus here on the inner workings of the garbage collector and other advanced characteristics of memory and resources management in .NET.

how to increase Performance onloading page and navigation of records ?? Help








this is my aspx and cs code , let me know whether it is correct or not??

onload and performance on navigation of record show be good.

Plz help me

<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"

                DisplayGroupTree="False" ReuseParameterValuesOnRefresh="true" HasToggleGroupTreeButton="False" Height="1039px" ReportSourceID="CrystalReportSource1"

                Width="901px" />

            <CR:CrystalReportSource ID="CrystalReportSource1" runat="

Entity Framework: Anti-Patterns To Avoid In N-Tier Applications


Danny Simmons explores some anti-patterns you should look out for when building n-tier applications with the Entity Framework.

Daniel Simmons

MSDN Magazine June 2009

Usability in Practice: Strategies for Designing Application Navigation


Good navigation makes for happy users, and happy users are good for your business. See what makes users happy this month.

Dr. Charles B. Kreitzberg and Ambrose Little

MSDN Magazine March 2009

SQL Security: New SQL Truncation Attacks And How To Avoid Them


Exploits using SQL injection have drawn a lot of attention for their ability to get through firewalls and intrusion detection systems to compromise your data layers. Whether it's a first-order or second-order injection, if you look at the basic code pattern, it is similar to any other injection issue where you use untrusted data in the construction of a statement.

Bala Neerumalla

MSDN Magazine November 2006

No More Hangs: Advanced Techniques To Avoid And Detect Deadlocks In .NET Apps


You can combat deadlock using a combination of disciplined locking practices which Joe Duffy aptly explains in this article.

Joe Duffy

MSDN Magazine April 2006

Extreme ASP.NET: Page Navigation


In my childhood I spent several weeks a year in Holland with my extended family. As a young American boy I was fascinated with the electric Dutch trains, something we didn't see in my hometown of Dallas, Texas.

Rob Howard

MSDN Magazine October 2005

Controls: Plan Your Migration to the Visual Studio 2005 Navigation Controls


Navigation is central to a well functioning Web application and it can be implemented numerous ways using today's technologies. This article highlights some of the key details of the new navigation controls that are part of the upcoming ASP.NET 2.0, and talks about how to design and implement one of these navigation controls today. This article contains a simple Web site that demonstrates the use of these navigation controls, pointing out some of the key items such as a breadcrumb control and things to watch for along the way. The article then describes how to implement a breadcrumb control today.

Dave Donaldson and Steven DeWalt

MSDN Magazine June 2004

Scale: Real-World Load Testing Tips to Avoid Bottlenecks When Your Web App Goes Live


Load testing should be part and parcel of every Web development effort, and it should be performed early in the process. However, if you think you can load test using your development environment, you're going to have some surprises when you go live. In this article, the authors outline the process of planning your load testing effort, considering which machines to use, how many users to simulate, which tools are right for you, and how to interpret your results.

Jeff Dunmall and Keith Clarke

MSDN Magazine January 2003

Enter key does not work for PasswordRecovery



On the following code for PasswordRecovery

 <asp:PasswordRecovery ID="PasswordRecovery1" Runat="server">
  <table border="0" cellpadding="1">
        <table border="0" cellpadding="0">
            <td align="center" colspan="2">
              Forgot Your Password?</td>
            <td align="center" colspan="2">
              Enter your User Name to receive your password.</td>
            <td align="right">
              <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>
              <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
              <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="PasswordRecovery1">*</asp:RequiredFieldVal

How do I avoid chunked encoding either in HttpListener or in SimpleWorkerRequest?



I am writing a simple web server that uses HttpListner (http.sys) as a listener and an output conduit, and a SimpleWorkerRequest to process ASP.NET requests. All works well, but when an application my server hosts outputs chunked response, ASP.NET calls SimpleWorkerRequest's SendResponseFromMemory() method and passes in data that is chunked-encoded. When I write the output to HttpListener's output stream, it gets chunk-encoded again, breaking the whole thing. So I ended up writing chunked decoder in the middle, which makes it inefficient because the response gets massaged three times instead of one:

  1. Chunked-encoded by ASP.NET HttpResponse, then
  2. Decoded by my code in the SimpleWorkerRequest.SendResponseFromMemory(), and
  3. Gets chunked-encoded again by writing to HttpListner's output stream.

My question is how do I tell either SimpleWorkerRequest or HttpListener not to chunk-encode the response so the encoding can be done only once by either of those? (Preferably, it's SimpleWorkerRequest that needs an option to pass the response to the web server without changing it so that HttpListener would encode all responses, whether the come from ASP.NET or not, for example from CGI request processor).

Thank you,

Search and Navigation Tips/Tricks with Visual Studio


This is the twenty-seventh in a series of blog posts I'm doing on the VS 2010 and .NET 4 release.

Today's blog post continues on from the Debugging Tips post I did last week, and covers some useful searching and navigation tips/tricks you can take advantage of within Visual Studio.  These tips were ones that my friend Scott Cate (who has blogged dozens of great VS tips and tricks here) recently recommended to me as good tips that most developers using Visual Studio don't seem to know about (even though most have been in the product for awhile). 

Hopefully this post will help you discover them if you aren't already taking advantage of them.  They are all easy to learn, and can help save you a bunch of time.

Ctrl + i - Incremental Search

Most developers using Visual Studio are familiar with the "Find dialog" that you can launch by pressing the "Ctrl + F" key within the IDE.  A surprisingly large number of developers, though, aren't familiar with the "Incremental Search"

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend