Click here to Skip to main content
15,905,915 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionhow to refresh only image control Pin
harithadotnet31-May-07 1:11
harithadotnet31-May-07 1:11 
QuestionSimple Export Pin
Sam Heller31-May-07 0:49
Sam Heller31-May-07 0:49 
AnswerRe: Simple Export Pin
SimulationofSai31-May-07 1:38
SimulationofSai31-May-07 1:38 
GeneralRe: Simple Export Pin
Sam Heller31-May-07 1:43
Sam Heller31-May-07 1:43 
GeneralRe: Simple Export Pin
SimulationofSai31-May-07 2:10
SimulationofSai31-May-07 2:10 
Questionhow to invoke button click event on enter key press Pin
vinodmattipalli31-May-07 0:38
vinodmattipalli31-May-07 0:38 
AnswerRe: how to invoke button click event on enter key press Pin
Christian Graus31-May-07 0:46
protectorChristian Graus31-May-07 0:46 
AnswerRe: how to invoke button click event on enter key press Pin
Sam Heller31-May-07 0:53
Sam Heller31-May-07 0:53 
<br />
     TextBoxThatIsFocuseWhenEnterPressed.Attributes.Add("onKeyPress", "doClick('" + ButtonToTriggerOnEnterPress.ClientID + "',event)")


Put that in the page load event.

And then this in the page

// Default button code<br />
function doClick(buttonName,e)<br />
    {<br />
//the purpose of this function is to allow the enter key to <br />
//point to the correct button to click.<br />
        var key;<br />
        <br />
        if(window.event)<br />
            key = window.event.keyCode;     //IE<br />
        else<br />
           key = e.which;     //firefox<br />
    <br />
        if (key == 13)<br />
        {<br />
            //Get the button the user wants to have clicked<br />
            var btn = document.getElementById(buttonName);<br />
            if (btn != null)<br />
            { //If we find the button click it<br />
                btn.click();<br />
                if(window.event) event.keyCode = 0;<br />
                <br />
            }<br />
        }<br />
   }


If it were me I would put the javascript code in a sperate js file and then reference it into the page. Why? Chances are you will use this elsewhere once youv'e got the function so it saves posting the code into each page.

If you didn't know you do it like this

<br />
    <script type="text/javascript" src="JavaScript/DefaultButtonScript.js"></script>

AnswerRe: how to invoke button click event on enter key press Pin
doWhileSomething31-May-07 2:29
doWhileSomething31-May-07 2:29 
QuestionI need a help Pin
tamilarasi31-May-07 0:29
tamilarasi31-May-07 0:29 
AnswerRe: I need a help Pin
Christian Graus31-May-07 0:46
protectorChristian Graus31-May-07 0:46 
QuestionPlease help me Convert from Pdf file to Html [modified] Pin
quangcoi31-May-07 0:22
quangcoi31-May-07 0:22 
QuestionDate funtion Pin
praveenkumar_mca31-May-07 0:17
praveenkumar_mca31-May-07 0:17 
AnswerRe: Date funtion Pin
Christian Graus31-May-07 0:33
protectorChristian Graus31-May-07 0:33 
AnswerRe: Date funtion Pin
Sherin Iranimose31-May-07 1:05
Sherin Iranimose31-May-07 1:05 
GeneralRe: Date funtion Pin
praveenkumar_mca31-May-07 1:24
praveenkumar_mca31-May-07 1:24 
GeneralRe: Date funtion Pin
Sherin Iranimose31-May-07 2:07
Sherin Iranimose31-May-07 2:07 
Questiontextbox problem Pin
Kissy1631-May-07 0:16
Kissy1631-May-07 0:16 
AnswerRe: textbox problem Pin
Christian Graus31-May-07 0:47
protectorChristian Graus31-May-07 0:47 
QuestionICICI PAYSEAL INTEGRATION WITH ASP.NET Pin
sameeran30-May-07 23:40
sameeran30-May-07 23:40 
AnswerRe: ICICI PAYSEAL INTEGRATION WITH ASP.NET Pin
Venkatesh Mookkan31-May-07 0:08
Venkatesh Mookkan31-May-07 0:08 
QuestionSearch engine Pin
Ashwani_kumar30-May-07 23:22
Ashwani_kumar30-May-07 23:22 
AnswerRe: Search engine Pin
dwatkins@dirq.net1-Jun-07 3:37
dwatkins@dirq.net1-Jun-07 3:37 
QuestionPlease help in innerHTML for newline character Pin
varshavmane30-May-07 23:10
varshavmane30-May-07 23:10 
AnswerRe: Please help in innerHTML for newline character Pin
dwatkins@dirq.net31-May-07 3:22
dwatkins@dirq.net31-May-07 3:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.