Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Get values with ASP.NET that was set by Java

Posted on 2006-06-29
3
Medium Priority
?
823 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
orbulat earned 2000 total points
ID: 17016149
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
ID: 17171956
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

609 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