.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

Changing Firefox values in about:config via Javascript

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
Hi WebGurus, I am currently facing a problem with Mozilla firefox JavaScript window.close() not working / does not work in firefox Is there any way of changing the values in about:config (specifically dom.allow_scripts_to_close_windows ) using Javascript, or via any other method when a page loads? Basically, I need a way of telling Firefox to close the window. If there is a better way of doing this please give me some guidelines regarding it. Thanks In Advance,Santosh

View Complete Post

More Related Resource Links

reading values from config files in NUnit tests


One of my NUnit tests has to read in some values from config files.  In my main application this process works perfectly well, however when I run the unit test, the code that reads in the values from the config files doesnt read anything in.  Ive tried putting app.config in my unit test project (I even tried web.config) but nothing seems to work.  Are there any special steps involved when reading from config files in an nunit test ?

Javascript fails in chrome and firefox, works fine in IE



I am customizing Newform.aspx i.e. hiding some fields, making other readonly etc. It works fine in IE but fails miserably in chrome and firefox i.e. readonly are no more readonly, hidden are no more hidden. Here is my code:

<script language="javascript" type="text/javascript">
    function autoFillFields()
       var ctrl = findacontrol("Reference Customer");
    var param = getURLParam('RefFromCust');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;
    var ctrl = findacontrol("RefReqOpptyId");
    var param = getURLParam('OpptyId');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;

    param = getURLParam('RefFromAE');
    properParam = replaceCharacters(param);
    setPeoplePicker("People Picker", properParam);
    hideFldCtrl("Approval Sta

how do i use javascript to change values of controls inside a gridview

i have 2 labels (lblRate,lblTotal) and a textbox (txtQuantity) in a itemtemplate of a gridview.I want to calculate the products of rate and quantity and show it in Total as the textbox loses focus...i cant use textchanged because i dont want the page to postback.How do i use javascript to achieve this??Please Help Urgently....<asp:TemplateField HeaderText="Rate">                <ItemTemplate>                    <asp:Label ID="lblRate" runat="server" Text='<%# Eval("Rate") %>' />                </ItemTemplate>            </asp:TemplateField> <asp:TemplateField HeaderText="Quantity">                <ItemTemplate>                    <asp:TextBox ID="txtQty" runat="server" />                </ItemTemplate>&

Javascript Error in Internet Explorer but works fine in Firefox

Hi All,i was working on one of the project as it is working fine in Firefox but it is giving the javascript exception in internet explorer.Errror:  Error says  "s" is undefined in the s.currencyCode="USD" line but "s" is defined in the external javascript file  s_code.jsCan anyone suggest the solution for this issue:Please find my code where the error is displayed <script type="text/javascript" language="JavaScript" >var s_account="mnsdev"</script><script type="text/javascript" language="JavaScript" src="http://media.world.com/ads/usen/rpt/Omniture/s_code.js"></script><script type="text/javascript" language="JavaScript" >s.currencyCode="USD"s.charSet="ISO-8859-1"s.SEMct = s.getQueryParam('s_kwcid');s.SEMct = s.getValOnce(s.SEMct,'SEM_ct',0);s.clickPast(s.SEMct,'event9','event10');s.SEMvar=s.getQueryParam('s_kwcid');s.SEMdate=new Date;s.SEMdate.setTime(s.SEMdate.getTime()+60*86400000)if(s.SEMvar){s.c_w('SEM_ck','1',s.SEMdate)}s.SEMchk=s.c_r('SEM_ck');if(s.SEMchk&&s.events)s.SEMok='ok';if(s.SEMvar||s.SEMok) s.t()

How to access querystring values from javascript after url rewriting?

Hi mates, I´m using ASP.NET 3.5 with C#. The problem that I have is the following. I´m using url rewriting (in the Global.asax file) and people see urls like this:http://localhost:1855/uk/london but after I rewrite the urls I work internally with querystring values and the urls become somehting like this:http://localhost:1855/post.aspx?co=1&ci=1In my Global.asax after I create the proper url with the querystring values I just apply it with the following sentence (this is an example):Context.RewritePath("/post.aspx?co=1&ci=1");The problem is that from javascript using the following function I access the first url and not the second:function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } } I need to access the querystring values because I need to load values in a textbox using jQuery.autocomplete and Web Services. Can anyone tell me how to access the rewritten url to get the querystring values?Thanks in advance mates

Compare initial and final values using javascript

My Page consist of  8 text box and Button named update...Initially when the page is called values are filled in to the textbox from the DB;here is wat i require1. at intial page load i want the values in of 8 textbox to stored in array in javascript .2. when pressing the button update, i need a method (javascript) to comapre the initial on load values with new values(ie if values of textbox is changed ) so           that the text box background color should displayed in different color..In Simple words ..i would like change back ground color of text box of changed values in the text box when clicking button update.please note that i would like this to be performed  by OnClientClick method of button

problem with changing cssclass name using javascript

function DoFocus(fld) { fld.className = 'textboxFocus'; } function ChangeToFocus() { document.getElementById('<%=tbComment.ClientID%>').className="textboxFocus"; } button1.Attributes.Add("OnClick", "ChangeToFocus();")//Not working tbComment.Attributes.Add("OnFocus", "DoFocus(this);")//Working I have two methods to change a control's css class (etc. textbox), however, javascript method 'ChangeToFocus' is not working but I do need that function or something could do the samething (I can't use DoFocus(fld) function as it need to pass that control's reference)     Many thanks for your help! Ray

changing config file after publishing


Is it ok to change the config file after publishing a site?  I use shared hosting.  

It would be nice to do things like change connection strings and smtp settings with out having to republish the site.

Custom membership provider not returning values from my web.config


I created a custom membership provider in my ASP.NET 4.0 web site, stored  in App_Code, and referenced in my web.config.

However, it doesn't appear to be pulling values out of web.config during initialization.

The code was taken from http://www.asp.net/general/videos/how-do-i-create-a-custom-membership-provider, and the only modifications were changing "connectionStringName" here to the name of my connection string:

    Dim ConnectionStringSettings As ConnectionStringSettings = _

The connection string always comes back as nothing in this line:

    If ConnectionStringSettings Is Nothing OrElse ConnectionStringSettings.ConnectionString.Trim() = String.Empty Then
      Throw New ProviderException("Connection string cannot be blank.")
    End If

No matter what I change the password format to in web.config, the default value here is always used:

    Dim temp_format As String = config("passwordFormat")
    If temp_format Is Nothing Then
      temp_format = "Has

hide gridview column using javascript. working in ie and firefox but In firefox, gridview data is sh


function EnableDisableGridViewColumn() {
               var AdvanceSearch = document.getElementById('<%= chkboxlist1.ClientID %>');
               var chkList = AdvanceSearch.getElementsByTagName("input");
               var dgTest = document.getElementById("gridview1")
               if (dgTest != null)
                   for (var i = 1; i < dgTest.rows.length; i++) {

                       if (chkList[0].checked == true && chkList[1].checked == true) {
                           dgTest.rows[0].cells[0].style.display = "block";

javascript is not working in firefox


Hi friends,


I have some javascript function on the master page and im calling the same function from the other forms which is using this masterpage.

The code is working fine in IE but not in firefox, google chrome, opera.

my javascript on master page is like this

< script type="text/javascript">

 function ClientPrint(str)







Adding Textbox values using javascript.


Hi All,

i am developing an application using ASP.NET with C#.

in my application i have 4 textboxes. they are 1. Textbox1




Changing the address in app.config at runtime ..AN ISSUE..HELP neede..

hi wcf champs.,

hmm...I have a problem..and seriously need a solution to get things done well..!!

Have developed a wcf Upload application,the wcf service is hosted on IIS..now,the endpoint address at the server is exposed at client(in app.config).If further the server ip changes to some other..then the address at the client must be changed..!right..ya I did something to handle this but ,its another problem..!!.

Let me say what i have done and why does that give a problem..


*.*.The server ip is stored in a xml file.When the application runs,it picks up the server ip and changes it in Client.exe.config...

*.And if there is EndpointotFound exception at the client,it asks the admin to check the ip of the server.

*.The admin checks it and if the server ip is changed,the admin changes the ip in the xml file (where server ip is stored).

now let me know.."IS THIS A RIGHT APPROACH TO SOLVE MY PROBLEM" ..But then there is a problem!!let me share that with u..


*.The ip that is picked from  xml and placed in Client.exe.config.

Urgent (Firefox : javascript tp get firstChild.value)


 This works fine in IE but it does not work in firefox

  function displayTimeDiff(s){
                var tr = s.parentNode.parentNode;   
                var tds = tr.childNodes;   
                var f = tds[4].firstChild.value;  //from   //this is undefine din firefox
                var t = tds[5].firstChild.value;  //to   //this is undefine din firefox


this part of the datagrid

                            <asp:Label runat="Server" ID="lbl_from" Text="From"></asp:Label>
                                                       <asp:TextBox runat="Server" ID="tb_time_from1" Columns="6" MaxLength="10" Text='<%#Container.DataItem("time_from")%>'
                        <HeaderStyle BackColor="WhiteSmoke" />


dynamic javascript of an .ascx control inside an updatepanel not changing on client between async po


I have a confusing state issue. I found a way around it, but I would like to know why this is happening. First of all, I am using .NET 3.5 and that can't change right now (an easy fix may be the fixed ID capabilities of .NET 4.0).

Type csType = this.GetType();
ClientScriptManager cs = Page.ClientScript;
string jScriptBlockName = "SignUpSignInNameAvailabilityScript";
if (!cs.IsClientScriptBlockRegistered(csType, jScriptBlockName))
{   //NOTE: verified code always enters this
    StringBuilder cstext2 = new StringBuilder();
    cstext2.Append("function GetSignUpSignInNameAvailabilityMessage() { var id = '"
          + CreateUserWizardStep1.ContentTemplateContainer.FindControl("iSignUpSignInNameAvailabilityMessage").ClientID
          + "'; alert(id); return id; }");
    cs.RegisterClientScriptBlock(csType, jScriptBlockName, cstext2.ToString(), true);

This code is in Page_Load of an ascx. The same control is drawn on two separate postbacks of an UpdatePanel in different places of the page thus giving them different client IDs. The code works correctly on the first refresh of web browser; but after UpdatePanel

Urgent:Create/Update Winforms grid columns and rows with config file values


I have legacy winforms datagrid , I have to add/replace columns with new values, My new column names and row values are changes as per new requirements , so I am looking to update datagrid form any config file , so in future for any new requirements , If I update my config file , it hast update existing datagrid.

Please suggest me the code; I am trying from 4 days and its urgent now.



Urgent:Create/Update Winforms grid columns and rows with config file values


I have legacy winforms datagrid , I have to add/replace columns with new values, My new column names and row values are changes as per new requirements , so I am looking to update datagrid form any config file , so in future for any new requirements , If I update my config file , it hast update existing datagrid.

Please suggest me the code; I am trying from 4 days and its urgent now.



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