Search Results

Search found 5 results on 1 pages for 'anthonypliu'.

Page 1/1 | 1 

  • Best practices for logging user actions in production

    - by anthonypliu
    I was planning on logging a lot of different stuff in my production environment, things like when a user: Logs In, Logs Off Change Profile Edit Account settings Change password ... etc Is this a good practice to do on a production enviornment? Also what is a good way to log all this. I am currently using the following code block to log to: public void LogMessageToFile(string msg) { System.IO.StreamWriter sw = System.IO.File.AppendText( GetTempPath() + @"MyLogFile.txt"); try { string logLine = System.String.Format( "{0:G}: {1}.", System.DateTime.Now, msg); sw.WriteLine(logLine); } finally { sw.Close(); } } Will this be ok for production? My application is very new so im not expecting millions of users right away or anything, looking for the best practices to keeping track of actions on a website or if its even best practice to.

    Read the article

  • Firefox error for signalR, but does not effect anything

    - by anthonypliu
    I get the 2 following errors in firefox when using signalR and I do not know why: Timestamp: 10/15/2012 3:53:48 PM Error: The connection to http://localhost:81/signalr/connect?transport=serverSentEvents&connectionId=84a7f433-0cc8-4baf-93e9-d4c3ca968466&connectionData=%5B%7B%22name%22%3A%22Chat%22%7D%5D&tid=7 was interrupted while the page was loading. Source File: http://localhost:81/Scripts/jquery.signalR-0.5.3.min.js Line: 9 and Timestamp: 10/15/2012 3:53:50 PM Error: no element found Source File: http://localhost:81/signalr/abort?transport=serverSentEvents&connectionId=84a7f433-0cc8-4baf-93e9-d4c3ca968466 Line: 1 Everything seems to work fine with SignalR and my application works as expected across all browsers, but I just get these errors in firefox only. Any ideas?

    Read the article

  • Is referencing a selector faster in jquery than actually calling the selector? if so, how much does it make a difference?

    - by anthonypliu
    Hi, I have this code: $(preview-button).click(...) $(preview-button).slide(...) $(preview-button).whatever(...) Is it a better practice to do this: var preview-button = $(preview-button); preview-button.click(...); preview-button.click(...); preview-button).slide(...); preview-button.whatever(...); It probably would be better practice to do this for the sake of keeping code clean and modular, BUT does it make a difference performance wise? Does one take longer to process than the other? Thanks guys.

    Read the article

  • What is equivalent to a php page setup in asp.net

    - by anthonypliu
    I program php, but I am trying to get into c# asp.net. In php I can make forms, custom html, etc into a seperate php file and just include it on the page that I desire. I understand asp.net has a master page which allows you to set the template for the whole website, but what If I want just a row of buttons to be on SOME pages, and not all? something separate to the master page that can be included on any page i desire? Also when its controllers is that when I use .ascx?

    Read the article

  • How to pass a variable through url and use it inside a controller

    - by anthonypliu
    I have this controller: public ActionResult Details(String UserName) { using (var db = new MatchGamingEntities()) { var Users = from m in db.Users join m2 in db.MyProfiles on m.UserId equals m2.UserId where m.UserName == UserName select new UserViewModel { UserName = m.UserName, LastActivityDate = m.LastActivityDate, Address = m2.Address, City = m2.City, State = m2.State, Zip = m2.Zip }; return View(Users.SingleOrDefault()); } } I type in the url Profiles/Details/hello, but it does not work, if I do Profiles/Details?UserName=hello then it works. I have another ActionResult just like this except taking in an int id as parameter and it works fine with the first url format.

    Read the article

1