Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

311
Visualizações
Why my Asp button doesn't works even i added Onclick Event inside modal popup?

I have used ASP Button and added OnClick event in it, but while clicking the button it doesn't works. Kindly help me out to sort out this!

HTML:

<asp:Button ID="Create_project" runat="server" Text="Create Project" OnClick="Create_project_Click"/>

Code Behind:

protected void Create_project_Click(object sender, EventArgs e)
    {
       Response.Write("Sucessfull");
    }

even i couldn't insert the values to database!

"Note: I am using this button(Create_project) inside the Ajax:modalpopupextender"

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You need to post the markup of the button or control that pops this dialog.

Using the ajax dialog? then say we drop two buttons on the form. The first button click will display the dialog pop, and the 2nd one has our button.

So, say like this:

        <asp:Button ID="Button1" runat="server" Text="Button" Width="102px" />
        <ajaxToolkit:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server"
            BehaviorID="Button1_ModalPopupExtender"  TargetControlID="Button1"
            PopupControlID="mycoolpop" 
            >
        </ajaxToolkit:ModalPopupExtender>

        <div id="mycoolpop" 
            style="border:solid;border-width:2px;width:25%;box-shadow: 10px 5px 5px grey;padding:9px;">
            <h2>Cool pop dialog</h2>
            <asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" />
        </div>

And we get this:

enter image description here

Now I in design mode double clicked on button2, and have this code:

   protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Write("The dialog button click");

    }

If I click on button2 (inside the dialog/modal), then a post-back will occur, and of course that will collopase the dialog (all post-backs do).

So, the we see this:

enter image description here

So, we need to see your markup, and what you doing and how you popping that dialog. Without you sharing that information, we can only take wild wild guesses as to what you actually doing here, and even worse guess as to what your problem is.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda