C# - An Online Code Cleaner/Helper Like Resharper?
Oct 29, 2010
Basically until i had resharper i noticed my code quality was good...but due to tight deadlines I hardly payed any attention to why the code was modified and what the new code did better. I would like to write my own code, but check it once in a while at my leisure to see how things can be made better.Is there any online tool which helps clean code or write smaller code somewhat like what resharper does?Something similar to JSlint.com for JavascriptIs there any online tool which can do this on C# code snippets?
View 1 Replies
Similar Messages:
Jun 5, 2010
I need to pass a value from the selected button in user control to the containing page. I have it working fine but only by using a bunch of if statements that strike me as ugly. Can't figure out how to use a switch statement which, I think, would be a bit less cumbersome. I'd welcome on how to clean up this code (obviously I'm new to delegates).
Here's the code:
User Control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DelegateUserControl.ascx.cs"
Inherits="Foobar.UserControls.DelegateUserControl" %>
<asp:Button ID="Button1" runat="server" Text="Button 1" onclick="Button_Click" />
<asp:Button ID="Button2" runat="server" Text="Button 2" onclick="Button_Click" />
<asp:Button ID="Button3" runat="server" Text="Button 3" onclick="Button_Click" />
User Control code behind:
using System;
namespace Foobar.UserControls
{
public delegate void SendButtonValueToPage(int buttonValue);
public partial class DelegateUserControl : System.Web.UI.UserControl
{
public static event SendButtonValueToPage SendButtonIdToPage;
[Code]....
View 6 Replies
May 3, 2010
I have an ASMX Web Service that has its code entirely in a code-behind file, so that the entire contents of the .asmx file is:
<%@ WebService Language="C#" CodeBehind="~/App_Code/AddressValidation.cs" Class="AddressValidation" %>
On my test machine (Windows XP with IIS 5), I set up a virtual directory just for this ASP.NET 2.0 solution and everything works great. All my code is separated nicely and it just works.However, when we deployed this solution to our Windows Server 2003 development environment, we noticed that the code only compiled when all of the code was dropped directly into the .asmx file, meaning that the solution didn't work with code-behind. We can't figure out why this is happening.
One thing that's different about our setup in our development environment is that instead of creating a separate virual directory just for this solution, we dropped it into an existing directory that runs a classic ASP application. So here we have a folder with an ASP.NET 2.0 application within a directory that contains a classic ASP application. Granted, everything in the ASP.NET 2.0 application works if all of the code is within the .asmx file and not in code-behind, but we'd really like to know why it's not recognizing the code-behind files and compiling it correctly.
View 3 Replies
Dec 28, 2010
I want to create a Asp.net web application in which, when the client opens it he will get an textbox to write his C / C++ code then on clicking SUBMIT I want to compile the code and if perfect deliver back the exe or if it has errors then display the errors. How do I go about the compiling part.
View 1 Replies
Oct 3, 2010
I have the following code in visual studio 2010:
TextBox1.Text = My.Computer.FileSystem.ReadAllText("C:UsersBabyDesktopSimulator websiteResourcesTextFile.txt")
It reads the text in the textfile and displays it in the textbox. However, this link only works on my computer. How do I change the code so that when published online, it still works on anybody's PC? I think i need to refer to a relative path, but do not know how this should be done.
View 1 Replies
Oct 1, 2010
i have been trying to pusblish my website online. When i did this, the website only displayed the code from the source rather than a functioning page.
View 2 Replies
May 14, 2010
I'm considering purchasing a resharper license but would like to know if there are any possible alternatives to resharper and how would you rate these compared to reharper? It doesn't necessarily have to be a free alternative but I would just like to know how good equivalent products are.
View 8 Replies
Dec 6, 2010
I am developing a simple online DBMS to browse my database online.... the main concern for me is to clear everything from the PC when the user disconnect so no body can go and click (Back) on the browser and see the pages if the user forgot to close it.. what I have done so far is :
[Code]....
I am sure this is not enough.. am I right? so what else I should include there?
View 13 Replies
Aug 13, 2010
Running solution with VB.NET & C#, ASP.NET, VS 2008 with ReSharper 5 Most of the time, ReSharper is working (redundant code grayed out, squiggles, etc.) Sometimes, on the same code where it was working, nothing is highlighted to show ReSharper is enabled. I haven't done anything except modify code and debug. What is going on that turns it on/off?
View 1 Replies
Feb 25, 2010
I want to create a Online Exam site in ASP.NET .In that i want to display Test based on the Date and time and the user can take the test at the time set my the Teacher.
For Example:
Teacher want to take C Test for the Mid Semester Test and the test is schedule on 1 May 2010,then the test should appear on the test page on the 1st may only and the user should be able to take the test on the set time.
The problem is that if i use System time then user can change the system time and can take the test schedule in future.
So i want to know how can implement this thing.I have given many online test but dont know how they work out the time and date logic.
View 2 Replies
Aug 4, 2010
I just installed ASP.NET MVC Preview 3 and created a new Razor ViewEngine project. The site works fine, but I have no Syntax Highlighting or Code Completion in the views. Is this a bug or a known limitation in the Preview? I am using VS 2010 Ultimate and Resharper 5.0.1659.36
View 2 Replies
Apr 4, 2011
Using VS2008 and R# 5 I'm running into an odd situation, where on an aspx page I keep getting
Cannot resolve symbol 'symbolname'
But the code compiles and runs fine. While having a fix for this would be great, I'm just trying to figure out if I'm losing my mind.
The CodeFile directive and Inherits directives are fine. If I compile the app or just let devenv sit for a bit it'll go away, but as soon as I save the aspx [via ctrl+s] R# suddenly has trouble with the Inherits attribute and flips out on every method in the page (OnClick etc).
// Anonymized of course but otherwise intact
<%@ Page AutoEventWireup="true" CodeFile="TestPage.aspx.cs" Inherits="TestPage" Language="C#" MasterPageFile="~/MasterPage.master" Title="Test Page Title" %>
This is mostly just a grievance, because since the code compiles it doesn't stop me from doing what I need.
I would post a bug report to the JetBrains site but first I would like to know I'm not alone. It could be my machine. Maybe when I roll to VS2010 in a couple weeks this will go away?
View 1 Replies
Apr 4, 2011
I just installed SP1 for VS2010, and since then I get error messages from Resharper for stuff that used to work and be ok for Resharper (5.1) before.
The error messages are "Cannot resolve symbol 'Eval'" and some other methods other than Eval.
How do I solve this?
Is there a fix?
Is there some resharper cache that I must delete/clear?
(The code compiles and runs as usual)
View 2 Replies
Dec 28, 2010
I was recently told by a colleague that VS 2010 has inbuilt features similar to Resharper (e.g. Ctrl T to find a class etc...). I have been experimenting with VS 2010 Ultimate edition but cannot seem to find these features.If the features exist could somebody point me in the right direction?
View 1 Replies
Nov 18, 2010
In the new ReSharper 5.0 there is some MVC specific features for highlighting View and Controllers in views when you type them as strings.
So with ReSharper the string below called "ViewName" will get highlighted and clickable for navigation.
Html.RenderPartial("ViewName", model);
My question is if its possible to write custom patterns for custom extension methods. In my case i have a extension method called:
Html.RenderPartialIf(myCondition, "ViewName", model);
But when I do this ReSharper wont find my view. So can it be done?
View 1 Replies
Mar 4, 2011
Is there any difference between accessing a property that has a backing field
private int _id;
public int Id
{
get { return _id; }
set { _id = value; }
}
versus an auto-property?
public int Id { get; set; }
The reason I'm asking is that when letting ReSharper convert a property into an auto property it seems to scan my entire solution, or at least all aspx-files.
I can't see any reason why there should be any difference between the two from outside the class. Is there?
View 1 Replies
Jan 5, 2011
How to add code to know visitors count and online visitors count ?
is there a good control or code ?
I use ASP.Net, C#.Net ad SQL Server
View 5 Replies
Jan 9, 2011
I followed MVC 2 source to create a CheckBoxList helper.
I was able to identify the problem I am having but not able to solve it.
On my view I have the following:
[Code]....
The problem is in the bold part ...
The newSelectList is equal to selectList but all items were deselected.
What am I missing?
View 3 Replies
Jan 20, 2010
I was wondering if it's possible to render an Html Helper in a View inside a codeblock. So instead of:
[code]....
And have this render. Of course as it is, it wont render, so is there a way to programically decide if a textbox can be added without having to have a million delimiters in the page to accomplish this?
View 2 Replies
Jul 1, 2010
I wanted to write a code for JQgrid in asp.net .I have tried the same in asp.net MVC,but i want it now in asp.net .n MVC we use Helper class,and return json data,so what to do in asp.net where helper class can not be used.Serialization can be done with data to get it in json.,but what about Htmlhelper.
View 2 Replies
Nov 26, 2010
I'm trying to use the Video helper (Microsoft.Web.Helpers) but nothing happens to Flash or Silverlight.
View 7 Replies
Feb 2, 2011
Can anyone help me with an alphabetical pager helper?
View 21 Replies
Mar 15, 2010
I am trying to create 2 Html helpers but that use the String Type as in MVC 2.
1. Html.FileFor Would render something like: <input type="file"
2. Html.Buttom and Html.Submit that would render <input type="button" or <input type="submit" In this case I suppose it makes no sense to have the For.
I know how to do (2) unless there would be something more than rendering the help and defining the Html attributes. However (1) I don't know how to do it
View 13 Replies
Feb 19, 2010
I would like to create a static helper method that I can call from a view.
Is it possible for a helper method to have access to the current ViewContext without needing to explicitly pass the ViewContext to the method as a parameter?
Something like HttpContext.Current except for ViewContext.
View 1 Replies
Aug 2, 2010
I would like to know how to run a MbUnit test in Visual Studio 2008 Professional. In the binDebug folder of my test project I have placed MbUnit.dll & Gallio.ddl.I have also installed ReSharper 5 plugin in Visual Studio I have made a MvcApplication1.Tests test project which is a Class Library.My test is just testing the Index() action of the HomeController in a default VS 2008 MVC project, it looks like this:
[Code]....
My question is very simple: HOW DO I RUN THIS TEST?
View 2 Replies