clientscript

How do I convert an ASP.NET page using Ajax webmethods to an Ajax-enabled servercontrol?

In this tutorial I am reading, Dave Ward creates a page that shows the server date in a label without using the update panel. I am trying to learn how to create servercontrols that use ajax for partial postbacks where methods within the control are called from clientscript generated by the same control, and I think that learning how to...

Can't get no javascript to execute on an ASP.NET user control

Hello, I'm trying to do the simplest thing, to show an alert popup through javascript from my code-behind of a user control (ascx.cs). I've tried protected void btnSave_Click(object sender, EventArgs e) { ScriptManager.RegisterStartupScript(btnSave, GetType(), "uniqueID", "alert('hello');", true); } as well as Page.ClientScrip...

Why can't you UnRegisterStartupScript??

Seems to me it is a bit wierd that you can do.. Page.ClientScript.RegisterStartupScript(this.GetType(), "KeyName", "alert('changed my mind')", true); And then later on you can't unregister or stop the javascript from being rendered programatically. Why would Microsoft do this? I don't like the work around here.. http://hemant-vikram...

Using Page.ClientScript.RegisterStartupScript doesn't appear to work after Server.Transfer

This should be a fairly simple question At some point in my code I am doing a Server.Transfer to a different page In the new page, there is a call (the details are irrelevant) Page.ClientScript.RegisterStartupScript(GetType(), name, js, true); However, this javascript never appears on the page. ...

asp button and history back onclientclick

hi I have an asp button like this <asp:Button ID="btnBack" OnClientClick='javascript:history.back()' runat="server" Text="back"> </asp:Button> now the javascript doesn't work to go a history back. but if I make an alert() it works...why how to solve this? thank you ...

Page.ClientScript gives "Children could not be evaluated"

I am trying to register a startupscript on a page but it doesn't register it. When i run the page in debug mode, and check the Page.ClientScript, it shows me "Children could not be evaluated" ...

Programmatically modifying an embedded resource before registering/referencing it on the page

Hi All, Firstly, "Modifying" may be the wrong term, I see a few people have posted online just asking whether they can actually modify an embedded resource. What I am wanting to to, is use a resource in my assembly as a kind of template which I would do a find and replace on before registering it on the page - is this possible? For exa...

At what asp.net page event are clientIDs assigned?

I want to do something like this: Panel divPanel = new Panel(); divPanel.ID = "divPanel"; this.Page.Controls.Add(divPanel); string script = "function alertID(){alert("the id is: "+divPanel.ClientID+");}"; this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "scripttests", script); But when I put this code in page_load, I...

How do I combine alert popup in save as file function in asp.net?

I'm tring to write a function that need to save a file (in csv) and has a condition. it's something like that: If the file is small then 1MB then I want to pop up an alert in javascript and then continue with the save as file commands. What I did was: if(...) { } else { ClientScript.RegisterStartupScriptBlock(...alert('aaa')...); } ...