eventClick: function (calEvent, jsEvent, view) {
$("#HiddenField2").val(calEvent.id_cliente);
$("#HiddenField1").val(calEvent.id);
$("#modalConsulta").modal();
I pass the values of calEnvent.id_cliente and calEvent.id_cliente to
modalConsuta. I have to run one sqldatasource select statment to get all the data from my table like this one
SqlDataSource1.SelectParameters.Clear();
SqlDataSource1.SelectCommand = "select * from clientes where id=?";
SqlDataSource1.SelectParameters.Add("@a", HiddenField2.Value);
SqlDataSource1.DataBind();
The click happens before the hide(). If the click is a full page refresh then the button CSS (state) is generated on the server which overwrites the HTML. Please use your debugging tools.
Member
423 Points
970 Posts
Run sqlStatment (Dqldatasource) when I open modal
Jul 22, 2019 11:24 AM|mariolopes|LINK
I fullcalendar I have the following code:
I pass the values of calEnvent.id_cliente and calEvent.id_cliente to modalConsuta. I have to run one sqldatasource select statment to get all the data from my table like this one
and show the values on modalConsulta.
Any help on this issue?
Thank you
https://programamos.pt
All-Star
53711 Points
24037 Posts
Re: Run sqlStatment (Dqldatasource) when I open modal
Jul 22, 2019 11:35 AM|mgebhard|LINK
A standard ASP.NET Web Forms Update Panel is required to invoke an SqlDataSource because an SqlDataSource is a member of the of the page class.
A very common approach is using AJAX or fetch to invoke an HTTP request to an HTTP endpoint. Then writing a bit of JavaScript to update the DOM.
Member
423 Points
970 Posts
Re: Run sqlStatment (Dqldatasource) when I open modal
Jul 22, 2019 12:08 PM|mariolopes|LINK
If I have one button with the sqlStatment on my modal I can run it (with click event) like this
And works fine. My problem: How can I hide Button4 after click?
https://programamos.pt
All-Star
53711 Points
24037 Posts
Re: Run sqlStatment (Dqldatasource) when I open modal
Jul 22, 2019 12:35 PM|mgebhard|LINK
jQuery Reference
https://api.jquery.com/hide/
Member
423 Points
970 Posts
Re: Run sqlStatment (Dqldatasource) when I open modal
Jul 22, 2019 01:49 PM|mariolopes|LINK
I try it but no luck
The Button is still visible
Maybe after sqldatasource complets the sql statment I will put the button visible=false. I don't understand why hide() is not working.
https://programamos.pt
All-Star
53711 Points
24037 Posts
Re: Run sqlStatment (Dqldatasource) when I open modal
Jul 22, 2019 01:53 PM|mgebhard|LINK
Have you verified the code is running by setting a break point?
Maybe you are using a content page and need to use the following construct?
We cannot see all the relevant code so we are guessing how your code works at this point.
Member
423 Points
970 Posts
Re: Run sqlStatment (Dqldatasource) when I open modal
Jul 22, 2019 03:27 PM|mariolopes|LINK
The problem is click() works in Button4 and hide() does not work
My source code
Why click() works ans hide does not work?
https://programamos.pt
All-Star
53711 Points
24037 Posts
Re: Run sqlStatment (Dqldatasource) when I open modal
Jul 22, 2019 03:36 PM|mgebhard|LINK
The click happens before the hide(). If the click is a full page refresh then the button CSS (state) is generated on the server which overwrites the HTML. Please use your debugging tools.