Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

308
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!