.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

javascript script works with alert() and does not fully work without it

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


Im facing the following problem i have a gridview that i insert an OnClick event to each row in order to be able to click on a row and selecting that row (change the color of the selected row e.tc) my javascript works fine when i have an alert when i remove the alert

then i see the color of the row changing as i click it but then when i move the mouse the color changes back to normal i still get the id of the row since i have a textbox where i put the id content of the e.row.cell[0] value .

I searched the web and i found out that its something to do with ajax and asychronous calls here is the code if the alert is enabled everything works fine this function is called from .c#

protected void GrdEntal_RowDataBound(object sender, GridViewRowEventArgs e)
            if (e.Row.RowType == DataControlRowType.DataRow)

                e.Row.Attributes.Add("onclick", "javascript:getID('" + e.Row.Cells[0].Text + "', '" + e.Row.ClientID + "', '

View Complete Post

More Related Resource Links

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 to work with javascript

Hi guys, as I'm not a .Net developer, I'm struggling with some simple problems using the language.   I'm trying to insert some javascript functionality, inside my page. What I'm trying to do below...   <script language=javascript> function ControlBackupFields(hasBackup) { if (hasBackup.checked = true) { document.aspnetForm.frequencyValue.enabled = true; document.aspnetForm.frequencyUnitList.enabled = true; } else { document.aspnetForm.frequencyValue.enabled = false; document.aspnetForm.frequencyUnitList.enabled = false; } } </script> <asp:datagrid id="dgData" runat="server" AutoGenerateColumns="False" PageSize="20" Width="100%" CssClass="grid" CellPadding="1"> <ItemStyle Height="20px" CssClass="tabletext2" VerticalAlign="Top"></ItemStyle> <HeaderStyle Height="20px" CssClass="tableheading2"></HeaderStyle> <Columns> <asp:TemplateColumn> <ItemTemplate> <asp:TextBox id="volumeID" Runat="server" Visible="false" /> <asp:Label id="volumeName" Runat="server" /> </ItemTemplate> </asp:TemplateColumn> <asp

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 does "Alert Me" work with simple web page?

In another post (http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/83ec9566-0357-4f40-9388-f364e87c1bd4/)  I've learnt how to make simple web pages in MOSS 2007. Then I want to "subscribe" some users using the "alert me" function but it doesn't seem to work.  Do I miss something or "alert me" doesn't work with simple web pages?  

Font on Page Becomes Bold After Javascript Alert -- Why?

In .Net 3.5   I have a web page that has several checkboxes, text boxes, dropdown boxes etc on it.  When a user clicks on the search button, I run some basic validation on the page. If any validation fails, I invoke a javascript alert letting them know what they did wrong and I return them to the page. However, when the page reloads, all of the text on the page is now larger and bold, even the text inside the menu and which resides in a master page.  I removed every instance of the word "bold" from the project but it still becomes bold after the alert fires. Any idea what could be causing this to happen?  It shouldnt matter but here is a sample of the alert I use: Response.Write("<script language='javascript'>alert('You must check at least one column to display');</script>") Any help is greatly appreciated. thanks

Javascript doesn't work on IE Mobile 6.12 ?

Hi, I wrote a simple asp.net page with few controls and a function in Javascript that make input validation. The javascript function is called on button click event. I use Windows Mobile 6 Classic emulator, and the javascript doesn't work at all.  I saw few posts on this forum saying that IE mobile works just with jscript and doesn't work with javascript. Is it correct ? Is that mean I have to change my javascript code to jscript code ? I always thought they are the same. Is there newer versions of ie mobile that works with javascript ? Thsnks, David

Edit in Datasheet view does not work on one SharePoint 2007 farm, works on another.

The ability to edit in datasheet view on one of our environments no longer works.  I've tried different client machines on different builds and regardless of the install every library, list, etc. when attempting to edit in datasheet view shows as read only.  Our other environments those systems work as intended with those same clients. I've searched all over and haven't found anything that helped.  Any ideas?

why the ValidateRequest dose not work when html tags had sent by __doPostBack method in javascript

hi friends.why the ValidateRequest dose not work when  html tags had sent by __doPostBack method in javascript.var encodedAllScripts="<html><td></td></html>"; __doPostBack('getHtmlData', encodedAllScripts);

why the ValidateRequest dose not work when html tags had sent by __doPostBack method in javascript

hi friends.why the ValidateRequest dose not work when  html tags had sent by __doPostBack method in javascript.<script>var encodedAllScripts="<html><td></td></html>"; __doPostBack('getHtmlData', encodedAllScripts);</script>

Javascript Alert after closing a modalpopup



I have a linkbutton 'Forgot Password?' in my login page. On click of the link button  a modal popup will open . In that user has to give his username.

If the username doesnot exists  i want to show an alert 'Usename doesnot ' exists. 

Since the checking for the existenance of the username is on click of the button submit which is inside the modal popup, i can show the alert using the code

Page.ClientScript.RegisterStartupScript(...) . But I want something different

I want to call the javascript function after the maodal popup extender is closed

Please help me.



returning data as hyperlink works but doesn't work


Please help. I have a form that searches my database and returns results well but each record contains a cell with a link to another html page. The problem is that whether I place the html pages in the same directory as the .asp codes or in a separate directory with the link being an absolute URL, the action of clicking on the link fails to redirect. Is it possible?

The returns are addresses and the link in each record is to it's own address page with google map.

How can I adapt the Javascript function below to work with my TextBoxes?


Hi all,

How can I adapt the Javascript function below to work with my TextBoxes?

<head id="Head1" runat="server">   
    <title>Untitled Page</title>   
    <script type="text/javascript">   
        function f(ta_id)   
            var d=document, ta, rng;   
                if(ta && ta.createTextRange)   
                 <asp:TemplateField HeaderText="Comments" SortExpression="Comments">
                      <asp:TextBox ID="txtBoxComments" runat="server" Width="800px" MaxLength="1000" ReadOnly="true" Rows="1" Text='<%# Eval("Comments") %>'
                       TextMode="MultiLine" Wrap="true" onscroll="f('txtBoxComments')" />

When I look at the "View Source" I

SqlClient Connection Works Fine with XP, will not work on Windows 7


Hello, I am programming in VS2010 wirting a simple windows forms program. I am using the System.data.SqlClient for a connection. My data Connection code:

'Used for reading data only



Public Function O

javascript alert window when dropdown field is selected,



is there a way..where an alert window prompts up to remind the user to select a checkbox when one field in dropdown is selected..for example

there is a dropdown field(Status)  which contains (Tobe confirmed, confirmed and rejected ), when confirmed is chosen..an alert window prompts up reminding the user to select a checkbox(send email) - Yes or No. It is not compulsory for the user to select the checkbox, but if Yes is chosen, the workflow will send an email

input button javascript does not work


Hi All,

I'm inserting panels within a table, each panel has an increment and decrement input button that uses javascript to update a textbox value within the panel.

The buttons stopped working when I adjusted the table to have multiple columns. 

Here's the code:

        private void OrderDriver()
            //Get vendor items
            MyItemList = new List<Item>();
            MyItemList = Populate();
            //Display vendor items
            Table tbl = new Table();
            int rowcount = getrowcount(MyItemList.Count);
            int colcount = 2;
            for (int i = 0; i < rowcount; i++)

                TableRow row = new TableRow();

                for (int j = 0; j < colcount; j++)

                    TableCell cell = new TableCell();

                    Panel Pnl = new Panel();
                    Pnl.ID = "Pnl" + i.ToString();
                    Pnl.Visible = true;
                    Pnl.BorderWidth = 4;
                    Pnl.BackColor = System.Drawing.ColorTranslator.FromHtml("#CC3333");
                    Pnl.Width = 500;

                    TextBox txtbx = new TextBox();
                    txtbx.ID = "txt" + i.ToString

Is it possible to disable all javascript functions which are set to work after a certain time, after


Is it possible to disable all javascript functions which are set to work after a certain time, after update panel asynchronous postback

as you alread know you can set certain functions to get executed after a certain time with setTimeout method

i want to disable all setTimeout method setuped functions after update panel asynchronous postback

is this possible

thank you

unmanaged C dll works in VS2005 but It doesn't work on other PC without it


I have a VB winforms, I use function from unmanaged C++ dll "Reserva.DLL" (Manifest: <assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>).

I use this code to call the functions:

  Private Declare Sub CreateReserva Lib "RESERVA.dll" ()
    Private Declare Sub DestroyReserva Lib "RESERVA.dll" ()
    Private Declare Sub DatosPozo 
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