Search Results

Search found 2 results on 1 pages for 'pstar'.

Page 1/1 | 1 

  • Visutal Studio Warning "Content is not allowed" in ASP.NET project

    - by pstar
    Hi, I am just started working as a programmer last month, so there will be plenty of newbie question come from me, stay tuned... I am now working on modify the provided template (from DevExpress) to create new web form using ASP.NET 2.0 on Visual Studio 2008. While the functionality of that web form is there, I am in the process of get rid of ninety something warning message, most of them come from the provided template. One of them puzzled me for a while is this one: "Warning 75 Content is not allowed between the opening and closing tags for element 'ClientSideEvents'." And here is the code: <dxe:ASPxListBox id="edtMultiResource" runat="server" width="100%" SelectionMode="CheckColumn" DataSource='<%# ResourceDataSource %>' Border-BorderWidth="0"> <ClientSideEvents SelectedIndexChanged="function(s, e) { var resourceNames = new Array(); var items = s.GetSelectedItems(); var count = items.length; if (count > 0) { for(var i=0; i<count; i++) _aspxArrayPush(resourceNames, items[i].text); } else _aspxArrayPush(resourceNames, ddResource.cp_Caption_ResourceNone); ddResource.SetValue(resourceNames.join(', ')); }"></ClientSideEvents> </dxe:ASPxListBox> I couldn't see anything wrong with the code myself, so please help me out here.

    Read the article

  • File being used by another process. Reason, and solution?

    - by pstar
    The process cannot access the file 'abc.log' because it is being used by another process. Hi, I've seen this exception from my application occationaly but I am still trying to fix that, hope I will get some insight from stackoverflow. In my application I've have defined a WriteToLog function which will write to a log file. Also the mainForm of my application will launch a backgroundWorker do some job which also calls the WriteToLog. Maybe two threads access a file will cause a problem? But in my code I 've already do my best to write flush and close the text file (I think), and here is my code from WriteToLog: StreamWriter sw = null; string newText = ""; try { //populate the content for newText sw = File.AppendText(LOG_FILE); sw.Write(newText); sw.Flush(); sw.Close(); } catch (IOException ex) { MessageBox.Show("Failed to write to log!\n\t" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { if (sw != null) { sw.Close(); } } I think as long as I flush and close the streamWriter, I should be able call the WriteToLog multi-times and in multi-threads isn't it? Or if I am wrong, could I simple make the file open shared, or there are other reason/solutions?

    Read the article

1