Skip to content
Advertisement

OnClick inside anything on Modal crash it

First of all, excuse me for my level of english and for beign baerly new on this.

I have this, it is a modal with a 2 gridsviews, a textbox and three buttons as you can see. The table i am hidding has a list of information from a sql data base.

Appears Modal

Whenever i click on a function inside a modal, for example a button or a row, cause i made possible to click on a row, the modal dissapears and crashes itself, like this.

After OnClick

ASPX Modal

JavaScript

C#

JavaScript

I have more code, but I think I have put the most relevant I would love a bit of help in this, thanks in advance

Advertisement

Answer

I found the problem, i apologize because I did not present valuable information, it turns out that it is a problem with the UpdatePanel that I have, that all the content is inside it.

The problem is that every time the update panel is updated when the server is called, the body remains the same, but the default modal has the fade that makes it hide, and therefore the page remains as shown in the second image.

So I moved the modal outside the updatepanel and put another one inside the modal like this.

Would be something like this

JavaScript

And the main update panel i add a updatemode conditional, cause if not both of them will update and the problem will not be solved.

I hope this helps someone if they need it, and I know I am explaining myself badly sorry for my lack of knowledge.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement