How to Pass Multi String Message from Model to View

I have a code which loop in 2 table and collect string if any exception thrown, ever time when another exception thrown the 1 message get deleted and am using list object, how to add multi string in list and send to view?
  1. foreach ( dicionary d in hashtable1)  
  2. {  
  3.    writer = xmlwriter.create()  
  4.    string strmsg = "";  
  5.    message = new List<string>  
  6.    try  
  7.    {  
  8.       some condition   
  9.    }  
  10.    catch( excep ex)  
  11.    {  
  12.       message.add(strmsg);  
  13.    }  
  14. }  
  15. foreach ( dicionary d in hashtable2)  
  16. {  
  17.    string strmsg2 = "";  
  18.    message2 = new List<string>  
  19.    try  
  20.    {  
  21.       some condition  
  22.    }  
  23.    catch( excep ex)  
  24.    {  
  25.       message2.add(strmsg2);  
  26.    }  
  27. }    
  28. writer.Flush();  
  29. writer.Close();  
I can see the strmsg & strmsg2 with value but when it come to close it get delete. how to added both table message as one list and send to view page?

Comments

Popular posts from this blog

40+ Tools to Advance Your International SEO Process

Asp.net Export WebPage with Images to PDF using iTextSharp in C#, VB.NET