Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

307
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda