Click here to Skip to main content
15,890,506 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Connecting/saving to ms sql 2005 database and querying the ms sql database Pin
Richard Deeming17-Sep-13 1:38
mveRichard Deeming17-Sep-13 1:38 
GeneralRe: Connecting/saving to ms sql 2005 database and querying the ms sql database Pin
Richard MacCutchan17-Sep-13 1:57
mveRichard MacCutchan17-Sep-13 1:57 
GeneralRe: Connecting/saving to ms sql 2005 database and querying the ms sql database Pin
Richard Deeming17-Sep-13 4:28
mveRichard Deeming17-Sep-13 4:28 
GeneralRe: Connecting/saving to ms sql 2005 database and querying the ms sql database Pin
Richard MacCutchan17-Sep-13 4:35
mveRichard MacCutchan17-Sep-13 4:35 
GeneralRe: Connecting/saving to ms sql 2005 database and querying the ms sql database Pin
Richard Deeming17-Sep-13 5:14
mveRichard Deeming17-Sep-13 5:14 
Questioninclude javascript within document write Pin
wfzen16-Sep-13 10:33
wfzen16-Sep-13 10:33 
AnswerRe: include javascript within document write Pin
twseitex25-Sep-13 5:01
twseitex25-Sep-13 5:01 
QuestionHow to call event using javascript? Pin
Sandesh M Patil16-Sep-13 2:49
Sandesh M Patil16-Sep-13 2:49 
My aspx page contains following code

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" language="javascript">
       
        function fnClickCalc() {

            document.getElementById('<%= btnCalc.ClientID  %>').click();
           
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    
        <table>
            <tr>
                <td> </td>
            </tr>
            <tr>
                <td><asp:Label ID="lblFirstNo"  runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td> </td>
            </tr>
            <tr>
                <td><asp:Label ID="lblsecondNo"  runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td> </td>
            </tr>
            <tr>
                <td><asp:Label ID="lblResult"  runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td> </td>
            </tr>
            <tr>
                <td><asp:Button ID="btnCalc" Text="Calculate"  runat="server" 
                        onclick="btnCalc_Click" /></td>
            </tr>
             <tr>
                <td> </td>
            </tr>
             <tr>
                <td><asp:Button ID="Button1" Text="Mirror Calculate"  runat="server" 
                        OnClientClick="fnClickCalc();" /></td>
            </tr>
        </table>
    </form>
</body>
</html>


My code behind file is,

protected void btnCalc_Click(object sender, EventArgs e)
{
           
     lblResult.Text = lblFirstNo.Text + lblsecondNo.Text;

            
}


When i click "Button1" button it fires btnCalc_Click event but i am not getting "55" result since page load again fires after "btnCalc_Click" event.

However if i click "btnCalc", it shows me desired output.

Any suggestions.. Smile | :)
Cheers,
SMP

My Recent Article

Main Method in C#


AnswerRe: How to call event using javascript? Pin
Richard Deeming16-Sep-13 3:51
mveRichard Deeming16-Sep-13 3:51 
GeneralRe: How to call event using javascript? Pin
Sandesh M Patil16-Sep-13 3:58
Sandesh M Patil16-Sep-13 3:58 
AnswerRe: How to call event using javascript? Pin
Akii Malam1-Oct-13 1:06
Akii Malam1-Oct-13 1:06 
Questionuse jquery to Made page controls Pin
fsj_fairy12-Sep-13 16:59
fsj_fairy12-Sep-13 16:59 
QuestionRe: use jquery to Made page controls Pin
ZurdoDev20-Sep-13 7:40
professionalZurdoDev20-Sep-13 7:40 
GeneralRe: use jquery to Made page controls Pin
Vasudevan Deepak Kumar29-Nov-13 1:28
Vasudevan Deepak Kumar29-Nov-13 1:28 
Questioni want to drag a picture and it stick to positions with jquery Pin
joonood12-Sep-13 4:48
joonood12-Sep-13 4:48 
AnswerRe: i want to drag a picture and it stick to positions with jquery Pin
Nitij16-Sep-13 0:51
professionalNitij16-Sep-13 0:51 
Questionhow to create an exception in a java code having sql query? Pin
Member 102614258-Sep-13 22:56
Member 102614258-Sep-13 22:56 
AnswerRe: how to create an exception in a java code having sql query? Pin
SoMad8-Sep-13 23:21
professionalSoMad8-Sep-13 23:21 
AnswerRe: how to create an exception in a java code having sql query? Pin
Dholakiya Ankit10-Sep-13 0:00
Dholakiya Ankit10-Sep-13 0:00 
QuestionPlease help urgent Conversion of string to array Pin
Chandra Sekhar.bs4-Sep-13 19:12
professionalChandra Sekhar.bs4-Sep-13 19:12 
AnswerRe: Please help urgent Conversion of string to array Pin
twseitex9-Sep-13 7:47
twseitex9-Sep-13 7:47 
QuestionButton click event in Google Maps Pin
Member 991209128-Aug-13 11:57
Member 991209128-Aug-13 11:57 
AnswerRe: Button click event in Google Maps Pin
jkirkerx29-Aug-13 9:28
professionaljkirkerx29-Aug-13 9:28 
QuestionNeed help with a function error Pin
lowkar20-Aug-13 1:57
lowkar20-Aug-13 1:57 
QuestionRe: Need help with a function error Pin
Richard MacCutchan20-Aug-13 2:47
mveRichard MacCutchan20-Aug-13 2:47 

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.