scriptmanager

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

不羁的心 提交于 2019-12-04 14:51:44
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? I tried googling for this, but I didn't find anything useful... Rob Windsor Your control does not

WebUIValidation.js gets reloaded in async calls when in CompositeScript and UpdatePanel

旧街凉风 提交于 2019-12-04 14:23:54
My scenario: I have a validator in an UpdatePanel . I want to combine my scripts so I am using CompositeScript in ScriptManager , and including a reference to WebUIValidation.js I am using .NET 4.0 My problem: When I asynchronously update the panel, .NET loads WebUIValidation.js (in a Scriptresource.axd file) in the async response, even though it has been loaded in the initial CompositeScript -generated script. This is a problem because I have custom code that hijacks some functions in WebUIValidation.js , and the async response overrides my hijacks. If you move the reference to

How to use ScriptManager in class file?

試著忘記壹切 提交于 2019-12-04 12:53:41
I Have a common method that displays alert message using page.clientScript. But later on i added update panel. Now this piece of code is not working. So I need to call there scriptmanager, but i get some error message that it is accessible there. Below is my ShowMessage method of common.cs file private static void ShowMessage(Page currentPage, string message) { var sb = new StringBuilder(); sb.Append("alert('"); sb.Append(message); sb.Append("');"); currentPage.ClientScript.RegisterClientScriptBlock(typeof(Common), "showalert", sb.ToString(), true); } So how do I use this method under update

Problem with ScriptManager.RegisterClientScriptBlock and jQuery in Internet Explorer 8

柔情痞子 提交于 2019-12-04 11:02:53
问题 I want to use jGrowl plugin for jQuery (http://stanlemon.net/projects/jgrowl.html#samples) to display some messages on a page. To do this, I call the ScriptManager.RegisterClientScriptBlock method like this: ScriptManager.RegisterClientScriptBlock(this, typeof(Page), Guid.NewGuid().ToString(), "$.jGrowl('" + message + "');", true); The code works perfect in Firefox/Chrome/Safari. However in Internet Explorer I don't see the notification and I don't get any Javascript error. I work under

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

你。 提交于 2019-12-04 08:43:30
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(); pageObject.sum(1,2); In My Userscript its my intention to create an object just like pageObject and call

ScriptManager EnableCdn - does not work on SSL

白昼怎懂夜的黑 提交于 2019-12-04 04:26:24
问题 I am trying to user EnableCdn property in ScriptManager. Basically I have this piece of code in my master page file: <asp:ScriptManager ID="MainScriptManager" runat="server" EnablePartialRendering="true" EnableScriptGlobalization="true" EnableScriptLocalization="true" AsyncPostBackTimeout="3600" EnableCdn="True"> This works on the dev environment where we connect via HTTP - it references to such script: <script src="http://ajax.aspnetcdn.com/ajax/4.5/5/WebForms.js" type="text/javascript"><

UpdatePanel with input type other than text in html5

家住魔仙堡 提交于 2019-12-03 13:00:03
I am developing an open source project for rendering HTML5 using ASP.NET. Here you can take a look: http://asphtml5.codeplex.com/ now I have a problem with update panel in posting back the input values that have type other than 'text'. as you might know, html 5 has introduced several input types, for example 'number', 'tel', 'search', etc. Now if I render such controls, everything works fine in normal situations, but if I put them inside an UpdatePanel, no value will be posted back and the value will be reset. here is a small piece of code that produces the same error: <asp:UpdatePanel runat=

Problem with ScriptManager.RegisterClientScriptBlock and jQuery in Internet Explorer 8

拈花ヽ惹草 提交于 2019-12-03 06:45:16
I want to use jGrowl plugin for jQuery ( http://stanlemon.net/projects/jgrowl.html#samples ) to display some messages on a page. To do this, I call the ScriptManager.RegisterClientScriptBlock method like this: ScriptManager.RegisterClientScriptBlock(this, typeof(Page), Guid.NewGuid().ToString(), "$.jGrowl('" + message + "');", true); The code works perfect in Firefox/Chrome/Safari. However in Internet Explorer I don't see the notification and I don't get any Javascript error. I work under Windows 7 and I have Internet Explorer 8 Beta (version 8.0.7000.0) and I have the same "bug" under

Navigate to a new page and display an alert box

五迷三道 提交于 2019-12-02 06:57:43
I am developing an application by using ASP.Net WebForm. Once user click a button, application will navigate to a new page and prompt out a dialog box "Welcome to JackiesGame" However, I able to navigate to new page but the alert dialog box does not display. The following is my sample code void cmdCancel_Click(object sender, EventArgs e) { HttpContext.Current.Response.Redirect(Globals.NavigateURL(TabId), true); Page page2 = HttpContext.Current.CurrentHandler as Page; ScriptManager.RegisterStartupScript(page2, page2.GetType(), "alertMessage", "alert('Insert Successfully')", true); } Add the

Why is the eval class giving me a casting error from int to double?

泄露秘密 提交于 2019-12-02 06:24:54
I am trying to make a method that takes a string formula, and solves the integral of that formula by doing a Riemann's sum with very small intervals. I am using the ScriptEngine and ScriptEngineManager classes to evaluate the function (with the eval() method). For some reason, I am getting this error: Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double at sum.integral(sum.java:31) at sum.main(sum.java:13) import java.beans.Expression; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script