Solved

Get values with ASP.NET that was set by Java

Posted on 2006-06-29
3
809 Views
Last Modified: 2008-01-09
Hi all!
   I'm using Infragistics' UltraWebGrid.  With this grid, I'm changing the backcolor of a cell (DarkBlue) when I click it.  If I click on it again, the backcolor is restored to it's original color (White); basically toggling the BgColor with each click.  The kicker is I'm accomplishing this with client-side events with Java to eliminate unnecessary postbacks.
   I've got an OK button on this page, as well.  When I click it, I wan't to be able to determine which cells are blue, and which are white.  The problem is, when I attempt to get the colors, nothing is returned (Color [Empty]).  I asked Infragistics about this and I was told that, because I'm setting the values of the cells with Java, ASP.NET cannot see the colors because they're set on the client and not the server.
  Question:  Is there a way or technique I can use to pass these grid color to ASP.NET for validation?

TO SET THE COLORS, I USE:
function UltraWebGrid1_CellClickHandler(gridName, cellId, button){
      var cell=igtbl_getCellById(cellId);
      
      if(cell.Element.style.backgroundColor=="blue")
      {
              cell.Element.style.backgroundColor="white";
      
      }
      else
      cell.Element.style.backgroundColor="blue";
}


0
Comment
Question by:CArnold
3 Comments
 
LVL 10

Accepted Solution

by:
orbulat earned 500 total points
Comment Utility
maybe u can try to use hidden variable

function UltraWebGrid1_CellClickHandler(gridName, cellId, button){
     var cell=igtbl_getCellById(cellId);
     
     if(cell.Element.style.backgroundColor=="blue")
     {
             cell.Element.style.backgroundColor="white";
             document.getElementById("hColor").value = "white";
     }
     else
    {
        cell.Element.style.backgroundColor="blue";
        document.getElementById("hColor").value = "blue";
    }
}

<input type=hidden runat=server id=hColor />

but make sure the ID of the hidden control is really "hColor" or not, because if u're using webusercontrol, the id will be "WebUserControl1_hColor"
u can check this by "view source"

then in your code behind, u can get the value from hColor
e.g
string result = hColor.Value;
0
 
LVL 1

Author Comment

by:CArnold
Comment Utility
Well, this answer did answer my question.  I was hoping for something more ASP.NET-centric, but it doesn't look like there is such a solution.

Thanks for your help, orbulat!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now