Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,


I have Disabled Enter key in whole application, i.e. on Master Page
HTML
<Form keydown="falseEnterKey()"></form>.


But i need Enter key enabled for a selected pages. i.e some pages textbox i want entry key enabled

So what i do,
Please give me solution.
Posted
Updated 9-Apr-12 2:20am
v3
Comments
Muralikrishna8811 4-Apr-12 6:03am    
Hi ,

Selected pages means you are maintaining list for those pages ha
Muralikrishna8811 9-Apr-12 8:24am    
Hi
check pagename or location.href values in falseEnterKey()
madhuri@mumbai 9-Apr-12 9:55am    
Please can you teel me that how can i access Hiddenfield value on masterpage(in javascript) from child aspx page.

Hi @Madhuri


you can use this following httpcontext class to get enable the falseEnterKey
here test.aspx is the page where you want to enablekey

C#
var page = HttpContext.Current.CurrentHandler as Page;
if (page.Page.ToString().Contains("test_aspx")))
{
enter the code to enable the enter key///////
}
else
{
////////////don't enable
}

Hope it will help you

Thanks
 
Share this answer
 
v2
Comments
madhuri@mumbai 4-Apr-12 6:55am    
its not working,
Ankur\m/ 4-Apr-12 9:09am    
Answerer wrote:
deepakaitr12345 - 1 hr ago
Let me know what you have done.... Thnaks
Ankur\m/ 4-Apr-12 9:10am    
Use the 'reply' link on the comment to reply.
Adding a comment to the answer won't send any notification to the commenter.
Since the functionality is not consistent throughout the web pages, you can just have the falseEnterKey() function in your master page. To call it or not should be decided in each web page.
 
Share this answer
 
Comments
madhuri@mumbai 4-Apr-12 9:19am    
Yes,I have alredy call it on my master Page,
but On some aspx pages,I want Enter key enabled,
Ankur\m/ 4-Apr-12 10:07am    
In that case you will have to write a function in all those 'some aspx pages' to do the reverse (i.e enable enter key).

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