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 5980213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:46:09+00:00 2026-05-22T21:46:09+00:00

<div> <% var index = 0; foreach (var item in Model) { %> <div

  • 0
    <div>
    <%
        var index = 0;
        foreach (var item in Model)
        { %>
    <div class="row <%= item.IsEditable ? "" : "readonly"%> 
                    <%= index % 2 == 0 ? "row":"rowAlt" %>  
                    var cId = <%= item.Id %>
                    <%= item.IsEditable ? "onclick='page.toggleMe(cId)'":"" %>                        
        <span style="float: right;">&nbsp;</span>
    </div>
    <%
        index++;
        } %>
</div>

The code above works on IE and toggles the row by passing cId. However, the same code doesn’t work in Firefox. I think it is not able to recognize the way cId is being passed.
I also tried:

<%= item.IsEditable ? “onclick=’page.toggleMe(<%= item.Id %>)'”:”” %>

but shows a syntax error. Any workarounds to get this working on FF?

  • 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-05-22T21:46:09+00:00Added an answer on May 22, 2026 at 9:46 pm

    I’ll attempt to post a fix for this, but there are quite a few mistakes in the code you posted; likewise, the way you are going about this is very awkward to say the least. Furthermore, I am unclear as to what your goal is.

    <div>
        <%
            var index = 0;
            foreach (var item in Model)
            { %>
        <div class="row <%= item.IsEditable ? "" : "readonly"%> 
                        <%= index % 2 == 0 ? "row":"rowAlt" %>"
                        id="<%= item.Id %>" 
                        <%= item.IsEditable ? "onclick='page.toggleMe(this)'":"" %> >                    
            <span style="float: right;">&nbsp;</span>
        </div>
        <%
            index++;
            } %>
    </div>
    

    Your toggleMe function should be changed to take the element instead of its id.

    • 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: @{ var index=0; } @foreach (AdminSummary adminSummary in @Model.AdminSummaries)
var foot = document.createElement(div); $('<div class=t></div><div class=b></div>').appendTo(foot); foot.id='foot'; //***** $(foot,'> .t').mouseover(function(){...}) i want to
PHP Code: <?php $i = 0; foreach ($this->productlist as $pro) { ?> <div class=link><a
I'm trying to do the following (I'm using the prototype library): var div =
var $container = $('div#myContainer'); var $panels = $('div#myContainer > div'); Is it possible to
var a=$('#start > div:last-child'); var b=$('#start > div.live')[0]; alert(a==b) alert(a==$(b)) It's always false. How
I have a Div with five float divs inside: var div=document.createElement(div); div.className=cssDivNino; var divFolio=document.createElement(div);
function sc_HTMLParser(aHTMLString){ var parseDOM = content.document.createElement('div'); parseDOM.appendChild(Components.classes['@mozilla.org/feed-unescapehtml;1'] .getService(Components.interfaces.nsIScriptableUnescapeHTML) .parseFragment(aHTMLString, false, null, parseDOM)); return parseDOM;
In the below code var panel= '<div id=title style=display:inline;font-size:150%;color:white;background:transparent;text-transform: none;width:150px;> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div> <div name=images id=name
In the below code var panel=<div name=panel id=panel style=display:inline;position: absolute; margin-left: auto;margin-right:auto;left: 0;right: 0;width:350px;height:

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.