when i disable controls in the form on client side they get disabled but ..
-
I'm using asp.net and c#. I have disabled the controls on the form using javascript on onclientclick of the Button. But they again are activated when postback occurs when I return "true" because of the same buttonclick. When I return "false" then only disabled controls are maintained. But I also want to run the code at codebehind on button click of the same button to disaplay a popup on some condition. but don't want other controls on the page to be activated.till that poup is not closed. so how to achieve disabling of the other controls on client side and displaying popup on server side. Please guide. Thank you.
yog hui gfgh kgdgrt njjn hjgkn
-
I'm using asp.net and c#. I have disabled the controls on the form using javascript on onclientclick of the Button. But they again are activated when postback occurs when I return "true" because of the same buttonclick. When I return "false" then only disabled controls are maintained. But I also want to run the code at codebehind on button click of the same button to disaplay a popup on some condition. but don't want other controls on the page to be activated.till that poup is not closed. so how to achieve disabling of the other controls on client side and displaying popup on server side. Please guide. Thank you.
yog hui gfgh kgdgrt njjn hjgkn
I don't really follow this ( how can you have a popup on the client side ), but you can use hidden controls to store values that change on the client side, and retrieve them on the server side to work out what HTML/script to render ( so after postback the control state does not change ).
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
I don't really follow this ( how can you have a popup on the client side ), but you can use hidden controls to store values that change on the client side, and retrieve them on the server side to work out what HTML/script to render ( so after postback the control state does not change ).
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Thank you for reply I don't want to display Popup using javascript but using c#. It means the code to display popup I'm using will run on server side not on client side. For this I want postback to be happened on button click event. This is possible if I use "return true;" in my javascript. But when there is postback all the disabled (that I made using javascript on clientclick event of the same button ) controls become enabled. So how to maintain the state of disability of controls even after postback of the page. This the problem for me . Might be clear to you now. Please suggest solution. Thank you.
yog hui gfgh kgdgrt njjn hjgkn
-
Thank you for reply I don't want to display Popup using javascript but using c#. It means the code to display popup I'm using will run on server side not on client side. For this I want postback to be happened on button click event. This is possible if I use "return true;" in my javascript. But when there is postback all the disabled (that I made using javascript on clientclick event of the same button ) controls become enabled. So how to maintain the state of disability of controls even after postback of the page. This the problem for me . Might be clear to you now. Please suggest solution. Thank you.
yog hui gfgh kgdgrt njjn hjgkn
yogita charhate wrote:
I don't want to display Popup using javascript but using c#. It means the code to display popup I'm using will run on server side not on client side.
You can't do that. A popup has to be opened on the client side.
yogita charhate wrote:
But when there is postback all the disabled (that I made using javascript on clientclick event of the same button ) controls become enabled.
That's because a new page is loaded. The controls that you did disable doesn't exist any more. If you want any controls in the new page to be disabled, you have to disable them.
--- single minded; short sighted; long gone;
-
yogita charhate wrote:
I don't want to display Popup using javascript but using c#. It means the code to display popup I'm using will run on server side not on client side.
You can't do that. A popup has to be opened on the client side.
yogita charhate wrote:
But when there is postback all the disabled (that I made using javascript on clientclick event of the same button ) controls become enabled.
That's because a new page is loaded. The controls that you did disable doesn't exist any more. If you want any controls in the new page to be disabled, you have to disable them.
--- single minded; short sighted; long gone;
thank you Guffa for reply. My problem is solved by calling the function (to disable controls) on pageload . But before calling that function I checked one flag's value which is set on server side when buttonclick event occure and some conditionds are fulfilled. have a nice day!! :)
yog hui gfgh kgdgrt njjn hjgkn