.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Client Script Replace Problem with .NET 4.0 ScriptManager

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net


I want to replace the WebUIValidation.js client script (located in System.Web assembly) with my own custom script using the new script replacement features in .NET 4.0.

The replacement works fine in a simple sample form I created, but in my much more complicated wizard form it fails.  On partial post-back the ScriptManager writes the System.Web version to the browser and I end up with both Microsoft's version and my version of the script in the browser. Since the System.Web version loads last, it replaces my custom script.

I am using the ToolkitScriptManager intead of the ScriptManager everywhere. The form that needs the replacement has dynamically created controls (including the validation controls) and has several control extenders based on the AjaxControlToolkit.

Does anyone have any ideas on what could be going wrong, or have any ideas on a workaround for this?

Any help will be appreaciated,


View Complete Post

More Related Resource Links

Problem registering client side script to interact with AJAX controls

Im using some animationExtenders in my project. The thing is, the objects to be animated are created programmatically, hence i need to also build programmatically the javascript code that will interact with them.It runs properly but, when i interact with these animated controls and the javascript functions are supposed to get to work, i keep getting the usual run-time error saying that the javascript functions are not defined. But, if i check the final html code generated, i can see how all the controls i built programmatically are there ,as well as the script.Tried both RegisterStartupScript and RegisterClientScriptBlock, no luck.Any advice? thanks in advance

Client script not running


Dear all,

in my MVC 2 application, and in the shared Master Page I wrote this little script for menu handling :

<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript"> $(document).ready(function () {   
     $('#nav li').hover(  
         function () {  
             //show its submenu  
             $('ul', this).slideDown(100);  
        function () {  
           //hide its submenu  
            $('ul', this).slideUp(100);           

The script, that shows menu items when the

Problem to obtain client IP on web service



I'm having problems to obtain the client IP on web service. Here's my scenario:

One server with Windows 2003, hosting the web service using .Net Framework 2.0, with IP and host name ServerTransaction.
Other server with Windows 2003, hosting a web application using .Net Framework 2.0, that consuming the web service on  ServerTransaction, with IP and host name ServerApplication.
Many other computers on the local network (IPs:,,, ...) acessing the web application on ServerApplication.

On the code of the web service I've tried to use HttpContext.Current.Request.UserHostAddress or HttpContext.Current.Request.ServerVariables("REMOTE_ADDR") or HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FORR"), but always I can only get the IP of ServerApplication (

Any idea or tip?

Thanks and sorry for my bad english.

passing object values from server to client problem


I get a message that x_login is not declared.  I added Dim login as String = "123", but that didn't help.  What's the problem?

code behind....

Dim Login = "123"
x_login.Value = loginID


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="simForm" runat="server" method='post' action='https://test.authorize.net/gateway/transact.dll'>
        <input id="HiddenValue" type="hidden" value="Initial Value" runat="server" />
        <input type='hidden' runat="server" name='x_login' id='x_login' />
        <input type='submit' runat="server" id='buttonLabel' />



Connection problem while connecting from client to server.

Hello, i am trying to connect sql server 2005 express using c#.net 3.5. my connection string is "Server=.\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\db_naren.mdf;Database=db_naren; Trusted_Connection=Yes;" this is working fine when i am connecting to sql server from the local machine. When i am trying to connect from someother machine to server it is giving error like A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) i added previliges in add new administrator on SQL Server 2005 Surface Area Configuration . and i made changes on SQL Server 2005 Surface Area Configuration  page, on Database Engine --> Remote Connections -->Local and remote connections --> Using both TCP/IP and named pipelines. still same error i am getting from client machine i am using connection string as "Server=MyServer\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\db_naren.mdf;Database=db_nare; Trusted_Connection=Yes;" is there any thing i need to do to connect from client machine to server?please

WCF Service client problem.

Hi,I have hosted a wcf service over IIS with Windows Authentication. All the users are able to access the WCF service Url from their machine. The problem is that some of the user are able to consume the webservice method while few of them when try to consume the service ,the error is thrown connection - reset error.I have tried to go through the IIS log also but it did'nt helped.Can any one help me regarding this. What settings I need to check/change to solve the proble.Thanks,AKB

Can I invoke a client side script from server side code

Hi is it possible to involk a client side script from the server side code without any interaction from the client side?Such as a popup or alert box?I know I can code this with the page load or the click event, I would like to call the alert from within my serverside code and trigger the action from there.Thanks

java script problem !

hi.i have this code : <asp:TextBox ID="TextBox1" runat="server" Width="92px"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="ok" Width="64px" /> <asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1"></asp:ListItem> <asp:ListItem Value="2"></asp:ListItem> <asp:ListItem Value="3"></asp:ListItem> </asp:CheckBoxList> and in button i have this code : If TextBox1.Text.Contains("1").ToString Then CheckBoxList1.Items.Item(0).Selected = True Else CheckBoxList1.Items.Item(0).Selected = False End If If TextBox1.Text.Contains("2").ToString Then CheckBoxList1.Items.Item(1).Selected = True Else CheckBoxList1.Items.Item(1).Selected = False End If If TextBox1.Text.Contains("3").ToString Then CheckBoxList1.Items.Item(2).Selected = True Else CheckBoxList1.Items.Item(2).Selected = False End If how i can do this code with javascript instead of vb code ?

Problem with java script basic script constraint.

 hi my code isfunction checkValue(){ if(''==document.getElementById ('textbox1').value) { alert('Please enter a value'); } }   and i am calling it on a button click event but its not responding. html code:  <asp:Button ID="btnButton" runat="server" Text="Button" onclick="checkValue()"/>   please help.

ScriptManager CompositeScript Error: A script reference cannot be included multiple times in composi

I am getting the following error using the CompositeScript feature of the ScriptManager.  I have ScriptManagerProxy in several different usercontrols that use CompositeScript to add whatever JS files they need.  Sometimes there are duplicates which would get removed by the script manager, but that is not happening with the Composite Scripts.  Looking at the stack trace, it calls RemoveDuplicates but for some reason it doesn't do so.  Is this a bug?  Is there a workaround or a hotfix? Thanks! A script reference cannot be included multiple times in composite script references. Stack Trace: [InvalidOperationException: A script reference cannot be included multiple times in composite script references.]   System.Web.UI.ScriptManager.RemoveDuplicates(List`1 scripts) +698   System.Web.UI.ScriptManager.RegisterScripts() +328   System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +113   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8695102   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1029

Url rewrite + ScriptManager = Client side error...

Hi All,   I am trying to build a asp.net website with url rewriting. I have retrieved a rewrite rule from my web host (see below) that I have added to my web.config file. The rule redirects all urls to my default.aspx as intended and every thing seems to work as it should.<rewrite> <rules> <rule name="Rewrite All" stopProcessing="true"> <match url="^(.*)$" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="Default.aspx" /> </rule> </rules> </rewrite>.until I add a ScriptManager to my page for partial updating of UpdatePanels. When I do this i get a client side (javascript) error as follows (see below). The error occures both on the initial page load and on postbacks. Viewstate is still working, but partial updates and ajax or any other javascript is not working because of the error below.Chrome javascript console: WebResource.axd:3Uncaught SyntaxError: Unexpected token <WebResource.axdResource interpreted as script but

Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when

We are migrating our application from windows server 2003 32 bit to windows server 2008 64bit, after I have created the virtual folder on the new machine, I am unable to connect to the database. We have oracle 11g client installed and below is the error which I am getting - </BR></BR> System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr svchp, IntPtr errhp, IntPtr dst_locp, IntPtr src_locp, UInt64 amount, UInt64 dst_offset, UInt64 src_offset) at System.Data.OracleClient.OCI.DetermineClientVersion() --- End of inner exception stack trace </BR>Any help is greatly appreciated, I have tried couple of solutions going through some threads online but no luck.

Problem with custom onBeginRequest-Handler on client-side when partial postback is triggered from ja

Hi, I have a Modal Dialog with a Ribbon, which starts a long running serverside operation. To inform the user about the progress, I implemented Dino Espositos "Progress Monitor Framework", which worked perfectly (after some work) - at least when I trigger the partial postback from a control inside the UpdatePanel used for displaying the progress. In this approach custom onBeginRequest and onEndRequest-Handlers are used to start and stop displaying the current status of the serverside operation. When I start the operation from a Button on the ribbon by doing "something" with the mentioned control via javascript the serverside operation is started, but my onBeginRequestHandler ist not called and the progress monitor is not "switched on" on the client. Here is what I´m doing in my javascript :  function pageLoad() { progressManager = new VCSharePoint.MultiEdit.Progress(); // Remove existing handlers Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(onBeginRequest); Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(onEndRequest); // Register handlers for UpdatePanel client events Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(onBeginRequest); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(onEndRequest); } // onBeginRequest() // Called w

Problem assigning a value to a variable in a Script Task

I've found loads of posts with the error I'm seeing: "The type of the value being assigned to variable [XXX] differs from the current variable type". However, I can't see anything that matches my scenario.  I'm simply trying to assign a value to a variable BEFORE passing the variable to an Execute SQL Task. I want to assign "true" or "false" to a Boolean variable called LogError, but as I got this error, I tried instead to assign 0 or 1 to it after converting it to an Int16 variable, but got the same result. I can see all manner of posts that make me wonder what I may have problems with next when I try to pass this variable to my stored proc that's expecting a BIT, but for now, I'd love SSIS to simply assign the value to the variable! Any ideas?

.NET Remoting Problem with Sponsor Renewal on CAO (Client Activated Object) Architecture

I have figured out a strange behaviour when using Client Activated Sponsorship and hope to get a hint from somebody who already got in touch with similar problems. The case is as follows: An Application is used by a server and a client. Both use (or try to use) the same objects after a user login. A lease of a session object on the server (serverSession) is initialised correctly with all of its regular remoting values in the lease for InitialLeaseTime (10) SponsorshipTimeout (5) RenewOnCallTime (10) In order to test the behaviour the values are set to seconds. It is easier to check the log every few seconds, than to wait some minutes until the Sponsorship Renewal call. If a client performs a login, the lease is according to its logged in state renewed each 10 seconds (or whatever the value is set to). So no problem so far. The lease will be alive as long as the client performs a logout, by the way it is used on a local network. Just compare the log (the renewal is firing every 10 seconds as expected): 2010-02-17 10:29:40.4338 Info Log5 SponsorObject:Renewal() 2010-02-17 10:29:50.4308 Info Log5 SponsorObject:Renewal() 2010-02-17 10:30:00.4328 Info Log5 SponsorObject:Renewal() 2010-02-17 10:30:10.4298 Info Log5 SponsorObject:Renewal() 2010-02-17 10:30:20.4318 Info Log5 SponsorObject:Renewal() 2010-02-17 10:30:30.4288 Info Log5 SponsorObject:Renewal() As soon as

Problem running jquery script in Content Page

Hi!! I have a master page in asp.net and a content page with some basic asp.net controls like textbox,buttons,treeview....i have a jquery script in the content page and reference set to the jquery file..The script changes the text property of a button on the keydown event set for the textbox...the script works fine if i copy and paste it in a normal page...the script only ran once when i worte it for the first time the next day when i tried to run the script it was not working..i m facing this problem for running the script in content page and i a m not aware of how to write jquery script for the content page.. i m really not finding any solution where i am wrong i have even tried setting the internet explorer security setting to low..plz plz plz plz plz plz help me on Thanks!!

Problem with IndexOf function in Java script?


Hi all,  i have one problem while using Index Of function in java script. I am using this in this way:

var ss=(document.getElementById('<%=HiddenField1.ClientID%>').value.indexOf(","+document.getElementById('<%=yyy.ClientID%>').value+"-"+document.getElementById(str).value,20));                       

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend