scriptmanager

How do you use ScriptManagerProxy in a custom ASP.NET control?

人走茶凉 提交于 2019-12-06 07:49:35
问题 Basically, I have created a custom control that uses an UpdatePanel, and as I understand it I need to use a ScriptManagerProxy to make it work ( since there should only be one ScriptManager per page, and is is declared in my .aspx page ).So, how do you use this beastie, is it just a matter of adding: <asp:ScriptManagerProxy ID="ScriptManagerProxy3" runat="server"> </asp:ScriptManagerProxy> to your control, or is there more to it? Could anyone please post a link to a good tutorial/example set?

How do I use constructor of a remote Page to create an Object in my Greasemonkey UserScript?

╄→гoц情女王★ 提交于 2019-12-06 02:47:42
问题 The page on which my userscript will run has a namespace, the namespace defines a constructor function. I would like to create an object using the same constructor and use methods of the object in my userscript. So far I have been unsuccessful. Here's what I am trying to do. The Page has the following native javascript block : var namespace={ constructor : function(){ this.sum = function(value1,value2){ alert(value1+value2); } } } being used like: var pageObject=new namespace.constructor();

ScriptManager.RegisterStartupScript not working on ASP Button click event

笑着哭i 提交于 2019-12-06 02:14:33
what I have tried I'm trying this since yesterday, to trigger a alert() when an ASP Button_Click . However, when I paste this script in Page_Load it works perfectly fine. ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "alert('Fill all fields.');", true); I have also tried it with below code, ClientScript.RegisterStartupScript which works on page load and not on ASP Button_Click ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('Fill all fields.');", true); what I need to do Need to validate the textboxes present in client side, if these textboxes are empty it

HTTP Handler cannot find axd file in nested web application folder: Telerik RadScriptManager cannot find WebResource.axd in ~/admin/ folder

拈花ヽ惹草 提交于 2019-12-05 21:05:09
We have a web application with 2 web.config files. I'm using the telerik:RadScriptManager control within an ASP.NET page. There is web resource file (WebResource.axd) that this control needs access to for it's ScriptReferences. I think this .axd file contains the JavaScript files for Telerik's controls. All of our Rad Controls are implemented in a separate web application (.csproj) project called "admin". The root web application project (.csproj) has a folder called "admin" where all of the admin project files live, including the admin web.config. The page I'm having an issue with here also

How to execute javascript once an update panel refreshes (Can't get Sys.WebForms.PageRequestManager.getInstance().add_endRequest(); to work)

≡放荡痞女 提交于 2019-12-05 11:49:41
I'm trying to run javascript once an update panel has refreshed. I've read a few places that you can use code similar to this: function codeToRun() { //Code Here } Sys.WebForms.PageRequestManager.getInstance().add_endRequest(codeToRun); But it doesn't seem to be working... any ideas? I've tried putting the code inside the Content area of the update panel as well as outside of it... haven't had any luck so far. Please let me know if you have any insight to why this might be happening. Thanks, Matt Everything needs to be outside of the UpdatePanel: Markup: <asp:ScriptManager ID="ScriptManager1"

Using a ScriptManager in razor?

☆樱花仙子☆ 提交于 2019-12-05 08:37:24
Must be a simple question, but I cannot for the life of me figure out how to include a script manager in my view. <asp:ScriptManager /> doesn't work. Anyone know? ScriptManager is a webforms specific construct, so if you are using MVC, you won't (and shouldn't) be able to use it. You can look at http://mvcscriptmanager.codeplex.com/ if you want something that ports some of the features of the scriptmanager to MVC. I ran into a similar situation upgrading a project. For "simple-ish" WCF Ajax services, I was able to get this work by adding: <script src="@Url.Content("~/Scripts/MicrosoftAjax.js")

How to retain script block on a partial postback?

岁酱吖の 提交于 2019-12-05 05:41:57
This is a problem I'm facing in a webapp I'm currently working on. So instead of cluttering the question with unrelated code, I recreated the problem in an isolated, simplified webapp that only demonstrates this issue. Hopefully this helps in finding a solution. I have a web user control with just this as its content: <% if (ShowAlertScript) { %> <script type="text/javascript"> function AlertMe() { alert('Hello World!'); } </script> <% } %> <input type="button" onclick="AlertMe()" value="Say Hello" /> And its codebehind has nothing more than the boolean definition of ShowAlertScript . This

ScriptManager.RegisterClientScriptInclude does not work in UpdatePanel

邮差的信 提交于 2019-12-05 05:24:01
I've read through the net but haven't found a solution to the following problem. I have this example page (_ScriptManager.aspx) with a ScriptManager , an UpdatePanel , a MultiView with two Views and two LinkButtons two switch between the views. The second view contains some functionality which I want to load a JavaScript file for (_ScriptManager.js). Since I don't know whether the user will ever visit view 2 I don't want to include the javascript file statically on for every request. I only want to load it if and when I need it. So I need to include the script file during an asynchronous

RegisterClientScriptBlock parameters usages in real scenarios?

旧巷老猫 提交于 2019-12-05 01:00:22
http://i.stack.imgur.com/dVjHt.jpg I never understood the real usage of the Control , type , key usages of this class. In general Ive always used with : this , GetType() , "xx" but now I truly want to understand . msdn : Control : " the control that is registering the client script" so...? what difference does it makes who registered it ? the script will be in the head of the page.. . Type : "the type of the client script block" type ??? its javascript. why does he want another type from me ? Key : "a unique indentifier" That I can understand - for cases which later to remove... but I'd love

How to call code behind method from a javascript function?

痴心易碎 提交于 2019-12-04 15:55:17
I am having an javascript function for a HTML img click event in aspx page. And a server Method in its code behind page.Now I want to call the server method from the javascript function without any parameter only when the HTML img is clicked by the user. C# Code Behind Method: [WebMethod] public void PopUpClick(object sender, EventArgs e) { //Something; } JavaScriptMethod: $(document).ready(function () { $('.clickme').click(function () { PageMethods.PopUpClick(); }); }); Also I added into the master page: <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"