Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8289317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:28:56+00:00 2026-06-08T12:28:56+00:00

I have in my code, and extended version of – string CurrMonth = Jan;

  • 0

I have in my code, and extended version of –

string CurrMonth = "Jan";
int rowId = 1;
string MIMO = "";
double JanMITotal = 0.0;
double JanMOTotal = 0.0;
//continued all the way to December

foreach (DataRow dr in dtMIMODetails.Rows) { //dtDetail has about 50 rows
  HtmlTableRow rowDetails = new HtmlTableRow();
  MIMO = dtMIMODetails["MIMO".ToString();
  {
    CurrMonth = "Jan";
    HtmlTableCell cell = new HtmlTableCell();
    cell.Style.Add(HtmlTextWriterStyle.BackgroundColor, "#FFFF99");
    cell.Style.Add(HtmlTextWriterStyle.TextAlign, "center");

    TextBox tb = new TextBox();
    tb.Style.Add(HtmlTextWriterStyle.BackgroundColor, "#FFFF99");
    tb.Style.Add(HtmlTextWriterStyle.TextAlign, "center");
    tb.Style.Add(HtmlTextWriterStyle.FontSize, "small");
    tb.Style.Add(HtmlTextWriterStyle.Width, "40px");
    tb.Style.Add(HtmlTextWriterStyle.Display, "None");
    tb.ID = "tb" + CurrMonth + "_" + MIMO + "_" + "_" + rowID;
    tb.Text = drMIMODetails[CurrMonth].ToString();

    HtmlAnchor htmlanchor = new HtmlAnchor();
    htmlanchor.ID = "ha" + CurrMonth + "_" + MIMO + "_" + rowID;
    htmlanchor.HRef = "#" + htmlanchor.ID;
    htmlanchor.Title = "Click to change value"; //tooltip
    htmlanchor.InnerText = drMIMODetails[CurrMonth].ToString();
    htmlanchor.Attributes.Add("onclick", "handleTextBox('" + CurrMonth + "', '" + MIMO  + "', '" + rowID + "', 'Show')");

    tb.Attributes.Add("onkeyup", "updateMIMOTotals('" + CurrMonth + "', '" + MIMO  + "', '" +  recordID + "','" + rowID + "')");
    tb.Attributes.Add("onblur", "handleTextBox('" + CurrMonth + "', '" + MIMO  + "', '" + rowID + "', 'Hide')");

    FilteredTextBoxExtender ftbe = new FilteredTextBoxExtender();
    ftbe.ID = "ftbe" + CurrMonth + "_" + MIMO + "_" + rowID;
    ftbe.TargetControlID = tb.ID;
    ftbe.FilterType = FilterTypes.Custom | FilterTypes.Numbers;
    ftbe.ValidChars = ".";

    cell.Controls.Add(tb);
    cell.Controls.Add(ftbe);
    cell.Controls.Add(htmlanchor);
    rowDetails.Cells.Add(cell);

    if (MIMO == MOVEINS) {
        JanMITotal = JanMITotal + Convert.ToDouble(drMIMODetails[CurrMonth]);
    }
    else if (MIMO == MOVEOUTS) {
        JanMOTotal = JanMOTotal + Convert.ToDouble(drMIMODetails[CurrMonth]);
    }
  }

  rowId++;
}

which is repeated for 12 months.

There are other values on this form, that when changed causes this loop to be run again, which is fine. I need to reload the values with the result that the other value change causes.

But after making that other change and reloading the page about 4-5 times, I get the dreaded “Stop running script?” error.

Is there a better way? I do have a javascript file that I use and am slightly familiar with jQuery.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:28:57+00:00Added an answer on June 8, 2026 at 12:28 pm

    It’s happening on one of the events you associated with the cell: onkeyup, onblur or onclick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code : string excelConnectionString = @Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\db\suc.xls; Extended Properties=Excel
I have extended a server control (not a user control) and put the code
Below is the snippet of my code. I have a JTable. I have extended
I have code that generates a List<string[]> variable but can't quite figure out how
I have code on my client that conflicts with a checked in version. Is
I have code in a managed bean: public void setTestProp(String newProp) { FacesMessage yourFailure
I am using (a slightly extended version of) the following code in a factory-pattern
I have code like this in my view model: function ChatListViewModel(chats) { var self
I have code which has a drop down list. And when a certain option
I have code that looks more or less like the code below but it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.