Solved

Get values with ASP.NET that was set by Java

Posted on 2006-06-29
3
814 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
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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