Click here to Skip to main content
15,947,476 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Setting the StatusCode of the response Pin
thatraja10-Jul-14 21:58
professionalthatraja10-Jul-14 21:58 
GeneralRe: Setting the StatusCode of the response Pin
ThetaClear12-Jul-14 21:37
ThetaClear12-Jul-14 21:37 
GeneralRe: Setting the StatusCode of the response Pin
ThetaClear12-Jul-14 22:54
ThetaClear12-Jul-14 22:54 
AnswerRe: Setting the StatusCode of the response Pin
jkirkerx11-Jul-14 11:17
professionaljkirkerx11-Jul-14 11:17 
QuestionDynamic reports in asp.net Pin
Member 105902599-Jul-14 21:17
Member 105902599-Jul-14 21:17 
AnswerRe: Dynamic reports in asp.net Pin
thatraja10-Jul-14 4:37
professionalthatraja10-Jul-14 4:37 
AnswerRe: Dynamic reports in asp.net (Using Formula Fields) Pin
Vikas Joshi (Sofware Developer)14-Jul-14 21:53
Vikas Joshi (Sofware Developer)14-Jul-14 21:53 
QuestionTexbox OnKeyPress event thru javascript executes a button click event Pin
bjay tiamsic8-Jul-14 15:23
bjay tiamsic8-Jul-14 15:23 
Hi.

I have an application consists of 2 textboxes, 2 buttons, a modalpopup extender.

Button1 and Textbox1 is in a modalpopupextender that is shown when a button is click (not shown here)

I added an OnKeyPress event on my textbox (Textbox1) on Page Load that will execute a javascript on client side code which calls a button (Button1) click event.]

C#
protected void Page_Load(object sender, EventArgs e)
    {       
 
               if (!Page.IsPostBack)
        {
            this.TextBox1.Attributes.Add("onKeyPress", "doClick('" + Button1.ClientID + "',event)");
        }
    }



This is the Javascript codes, this will call and execute the click event of Button1
JavaScript
function doClick(buttonName, e) {
           //the purpose of this function is to allow the enter key to
           //point to the correct button to click.
           var key;
           if (window.event)
               key = window.event.keyCode;     //IE
           else
               key = e.which;  //firefox
           if (key == 13) {

               var btn = document.getElementById(buttonName);
               if (btn != null) { //If we find the button click it
                   btn.click();
                   event.keyCode = 0
               }
           }
       };

This is the Button1 Click event
C#
 protected void Button1_Click(object sender, EventArgs e)
    {
        if (Textbox1.Text.ToString() == "ITDevt")
        {
            Button2.Visible = true;
            Textbox2.Visible = false;
Button2.Visible=true;
Button1.Visible=false;
            popup.Show();
        }
        else
        {
            popup.Hide();
            Textbox1.Text = "";
        }
    }



Assume that the modalpopupextender is shown, so I entered a text in Textbox1 and presses Enter key on keyboard (so the OnKeyPress event is rendered).
When I trace the Button1_Click event, the code block runs. But the popup (modalpopupextender) hides.

Can you help me show again the modalpopupextender and hide Button1 and Textbox1 then show Button2 and Textbox2?
QuestionGridView Structure Clone Pin
sakalans8-Jul-14 5:35
sakalans8-Jul-14 5:35 
AnswerRe: GridView Structure Clone Pin
thatraja9-Jul-14 0:44
professionalthatraja9-Jul-14 0:44 
QuestionASP MVC 5 application users Pin
AnCristina8-Jul-14 2:05
professionalAnCristina8-Jul-14 2:05 
AnswerRe: ASP MVC 5 application users Pin
Vi(ky8-Jul-14 2:27
Vi(ky8-Jul-14 2:27 
GeneralRe: ASP MVC 5 application users Pin
AnCristina8-Jul-14 6:51
professionalAnCristina8-Jul-14 6:51 
GeneralRe: ASP MVC 5 application users Pin
Vi(ky8-Jul-14 22:46
Vi(ky8-Jul-14 22:46 
GeneralRe: ASP MVC 5 application users Pin
AnCristina9-Jul-14 0:04
professionalAnCristina9-Jul-14 0:04 
GeneralRe: ASP MVC 5 application users Pin
Vi(ky10-Jul-14 2:18
Vi(ky10-Jul-14 2:18 
GeneralRe: ASP MVC 5 application users Pin
AnCristina11-Jul-14 20:57
professionalAnCristina11-Jul-14 20:57 
Questionbally chohan and baljinder chohan integration with same domain using php? Pin
gauravkumar027-Jul-14 23:14
gauravkumar027-Jul-14 23:14 
AnswerRe: bally chohan and baljinder chohan integration with same domain using php? Pin
Richard MacCutchan8-Jul-14 1:29
mveRichard MacCutchan8-Jul-14 1:29 
QuestionRe: bally chohan and baljinder chohan integration with same domain using php? Pin
Richard Deeming8-Jul-14 1:56
mveRichard Deeming8-Jul-14 1:56 
AnswerRe: bally chohan and baljinder chohan integration with same domain using php? Pin
Richard MacCutchan8-Jul-14 2:50
mveRichard MacCutchan8-Jul-14 2:50 
AnswerRe: bally chohan and baljinder chohan integration with same domain using php? Pin
Bernhard Hiller8-Jul-14 22:59
Bernhard Hiller8-Jul-14 22:59 
QuestionMovie not loaded message when pointing embed src to "d:\abc\story.swf" Pin
SURESH_KATARI7-Jul-14 20:36
SURESH_KATARI7-Jul-14 20:36 
AnswerRe: Movie not loaded message when pointing embed src to "d:\abc\story.swf" Pin
thatraja7-Jul-14 21:08
professionalthatraja7-Jul-14 21:08 
GeneralRe: Movie not loaded message when pointing embed src to "d:\abc\story.swf" Pin
SURESH_KATARI7-Jul-14 21:19
SURESH_KATARI7-Jul-14 21:19 

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.