?
Solved

Get values with ASP.NET that was set by Java

Posted on 2006-06-29
3
Medium Priority
?
821 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

Industry Leaders: 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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

777 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