Click here to Skip to main content
15,885,435 members
Home / Discussions / C#
   

C#

 
QuestionSaving stream as a PDF file to disk Pin
Member 1171394224-Jun-15 12:17
Member 1171394224-Jun-15 12:17 
AnswerRe: Saving stream as a PDF file to disk PinPopular
Sascha Lefèvre24-Jun-15 13:53
professionalSascha Lefèvre24-Jun-15 13:53 
GeneralRe: Saving stream as a PDF file to disk Pin
Member 1171394227-Jun-15 0:38
Member 1171394227-Jun-15 0:38 
QuestionHelp with Windows Form and IF statement Pin
Member 1147010024-Jun-15 9:04
Member 1147010024-Jun-15 9:04 
GeneralRe: Help with Windows Form and IF statement Pin
Sascha Lefèvre24-Jun-15 9:41
professionalSascha Lefèvre24-Jun-15 9:41 
GeneralRe: Help with Windows Form and IF statement Pin
Member 1147010024-Jun-15 11:19
Member 1147010024-Jun-15 11:19 
GeneralRe: Help with Windows Form and IF statement Pin
Sascha Lefèvre24-Jun-15 12:03
professionalSascha Lefèvre24-Jun-15 12:03 
QuestionStore one value from rows of data in a table Pin
Rajesh_198024-Jun-15 8:37
Rajesh_198024-Jun-15 8:37 
I have a table with 3 columns. Container # , Container Size and Pickup Location.

I am looping through each of the rows and append all the data to a string variable.

However, I also need to store the Pick up location(input by user, and will be same for all containers in a request) to be stored in a variable. How do I go about it?
C#
 var pickLoc = document.getElementById('_pickLoc');//_pickLoc is a Hidden Variable

for (i=1; i<=lastRow; i++) 
    {
        var dataStr;
        var localvar;
       
	  //Validating Container number
      var aRow = document.getElementById('txtRow' + i);
      if (aRow.value.length <= 0) 
      {
        alert('Row ' + i + ': Container number is empty');
        document.getElementById('txtRow' + i).style.backgroundColor = "#ffff99";
        document.getElementById('txtRow' + i).focus();
        return;
       }
       else {
            
            document.getElementById('txtRow' + i).style.backgroundColor = "";
			dataStr = "<tr><td height=5></td></tr><tr><td><FONT face='Verdana' size='1'>";
			dataStr += document.getElementById('txtRow' + i).value;
			dataStr += "</Font></td><td><FONT face='Verdana' size='1'>";
        }
       
       //_cntrSize
      	var e = document.getElementById('_cntrSize' + i);
	  if (e.options[e.selectedIndex].value == "") 
	  {
		 //dataStr +=  '</td></tr><tr>';
		 alert('Row ' + i + ': Container Size is empty');
		 e.style.backgroundColor = "#ffff99";
         e.focus();
         return;
		}
       else {
			 e.style.backgroundColor = "";
			 dataStr += e.options[e.selectedIndex].value;
			 dataStr +=  "</Font></td><td><FONT face='Verdana' size='1'>";
		}
		
		//Pickup Location Type
      var LocRow = document.getElementById('txtLocRow' + i);
      if (LocRow.value.length <= 0) {
        alert('Row ' + i + ': Pick up location is empty');
        document.getElementById('txtLocRow' + i).style.backgroundColor = "#ffff99";
        document.getElementById('txtLocRow' + i).focus();
        return;
       }
       else {document.getElementById('txtLocRow' + i).style.backgroundColor = "";
			 dataStr += document.getElementById('txtLocRow' + i).value;
			 dataStr += "</Font></td><td><FONT face='Verdana' size='1'>";
			 localvar = document.getElementById('txtLocRow' + i).value;
        }
        pickLoc.Value = localvar; 	
	 ttlStr += dataStr;
    }

SuggestionRe: Store one value from rows of data in a table Pin
Richard Deeming24-Jun-15 8:51
mveRichard Deeming24-Jun-15 8:51 
GeneralRe: Store one value from rows of data in a table Pin
Rajesh_198025-Jun-15 4:15
Rajesh_198025-Jun-15 4:15 
QuestionCan we overload an abstract method of an abstract class? Pin
NJdotnetdev24-Jun-15 7:20
NJdotnetdev24-Jun-15 7:20 
AnswerRe: Can we overload an abstract method of an abstract class? Pin
Richard Deeming24-Jun-15 7:40
mveRichard Deeming24-Jun-15 7:40 
GeneralRe: Can we overload an abstract method of an abstract class? Pin
NJdotnetdev24-Jun-15 7:52
NJdotnetdev24-Jun-15 7:52 
AnswerRe: Can we overload an abstract method of an abstract class? Pin
maddymaddy1425-Jun-15 19:37
maddymaddy1425-Jun-15 19:37 
QuestionAn abstract singleton factory Pin
Marco Bertschi24-Jun-15 1:48
protectorMarco Bertschi24-Jun-15 1:48 
AnswerRe: An abstract singleton factory Pin
Eddy Vluggen24-Jun-15 2:35
professionalEddy Vluggen24-Jun-15 2:35 
GeneralRe: An abstract singleton factory Pin
Marco Bertschi24-Jun-15 2:48
protectorMarco Bertschi24-Jun-15 2:48 
GeneralRe: An abstract singleton factory Pin
Eddy Vluggen24-Jun-15 8:21
professionalEddy Vluggen24-Jun-15 8:21 
AnswerRe: An abstract singleton factory Pin
Richard Deeming24-Jun-15 4:29
mveRichard Deeming24-Jun-15 4:29 
AnswerRe: An abstract singleton factory Pin
Dave Kreskowiak24-Jun-15 5:17
mveDave Kreskowiak24-Jun-15 5:17 
QuestionExtension Methods in .NET 2 Pin
Member 1171394223-Jun-15 20:43
Member 1171394223-Jun-15 20:43 
AnswerRe: Extension Methods in .NET 2 Pin
OriginalGriff23-Jun-15 20:53
mveOriginalGriff23-Jun-15 20:53 
SuggestionRe: Extension Methods in .NET 2 Pin
Richard Deeming24-Jun-15 1:17
mveRichard Deeming24-Jun-15 1:17 
GeneralRe: Extension Methods in .NET 2 Pin
OriginalGriff24-Jun-15 1:34
mveOriginalGriff24-Jun-15 1:34 
GeneralRe: Extension Methods in .NET 2 Pin
Member 1171394224-Jun-15 12:11
Member 1171394224-Jun-15 12:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.