c# - Calling method on Master page from WebMethod -
or any viable alternative solution.
So, imagine a master page that the tool IFooMaster
with a method ShowFancyMessagePopupTheBusinessCantLiveWithout (string message);
I am on a page that receives this master page, if a checkbox is unchecked, I want to send a message to the user that if he saves it, then some administrators Can not check the checkbox again without action.
I have been given feedback that I can not use just one alerts ('message');
In Javascript because they want to show these messages continuously
Next, I tried to make an AJAX call through PageMethods to show a message (as all the use of this codebase Does). My problem lies in this method being frozen. ("IFooMaster Master") .ShowFancyMessagePopupTheBusinessCantLiveWithout ("You think that's unchecked, you can re-check it. can not do. "); }
Since
ShowSuperImportantMessage ()
is stable
, I can not use master
from within .
The method on the Master page looks more or less like this:
Public Zero ShowFancyMessagePopupTheBusinessCantLiveWithout (String Message) {lblGenericMessage.Text = Message; BtnGenericMessageOK.Focus (); UpGenericMessage.Update (); MpeGenericMessage.Show (); }
mpeGenericMessage
is a ajaxtoolkit: .. ModalPopupExtender
upGenericMessage
is an updated panel
The other 2 are obvious.
Any thoughts? Can I do some Kung Fu jQuery to show that thing? I tried, but the solution complained that the control I tried to refer to by clientId did not solve because they were on the master page.
Quick Edit : Architecture is a problem before anyone can tell me, or I should not put such a thing on the master page, or w / e ...
I know that the situation is not ideal, but I have this legacy code, and I can not leave it all and do not want to rewrite half of my web pile.
Try something like this (unprotected):
( (IFooMaster) (HttpContext.Current.Handler) (.master).
This does not seem to be working - Master
on page- If the method is called (understandable), then it is not bowed.
Therefore, instead, create a blank page using the same master page, accept that page with either a post or a GET, which is necessary for you to pass through your master-page method. Remove the Page_Load parameter and call the method. As a result, to use the Response.Write
, you should use the result (and remember to change the content-type) to call your client-side code page and get the results.
Comments
Post a Comment