Click here to Skip to main content
15,900,816 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: 2010 asp.net options Pin
rachel_m15-Nov-11 16:29
rachel_m15-Nov-11 16:29 
GeneralRe: 2010 asp.net options Pin
Not Active15-Nov-11 17:23
mentorNot Active15-Nov-11 17:23 
QuestionProblem Setting Width of asp:Panel in Windows 7 Pin
Member 840472315-Nov-11 8:45
Member 840472315-Nov-11 8:45 
QuestionHidden Input value during <code>Page.Init</code> Pin
Ali Al Omairi(Abu AlHassan)15-Nov-11 5:42
professionalAli Al Omairi(Abu AlHassan)15-Nov-11 5:42 
AnswerRe: Hidden Input value during Page.Init Pin
Dennis E White15-Nov-11 6:31
professionalDennis E White15-Nov-11 6:31 
GeneralRe: Hidden Input value during Page.Init Pin
Ali Al Omairi(Abu AlHassan)15-Nov-11 7:03
professionalAli Al Omairi(Abu AlHassan)15-Nov-11 7:03 
AnswerRe: Hidden Input value during Page.Init Pin
jkirkerx15-Nov-11 18:26
professionaljkirkerx15-Nov-11 18:26 
GeneralRe: Hidden Input value during Page.Init Pin
Ali Al Omairi(Abu AlHassan)15-Nov-11 21:39
professionalAli Al Omairi(Abu AlHassan)15-Nov-11 21:39 
QuestionList (of ) remove, compare Pin
byka15-Nov-11 2:00
byka15-Nov-11 2:00 
AnswerRe: List (of ) remove, compare Pin
Dennis E White15-Nov-11 6:41
professionalDennis E White15-Nov-11 6:41 
Questionupdate button on web page Pin
rachel_m15-Nov-11 1:43
rachel_m15-Nov-11 1:43 
AnswerRe: update button on web page Pin
Dennis E White15-Nov-11 6:34
professionalDennis E White15-Nov-11 6:34 
QuestionIs there any design pattren for authentication in ASp.Net MVC3? Pin
wasimsharp14-Nov-11 23:34
wasimsharp14-Nov-11 23:34 
AnswerRe: Is there any design pattren for authentication in ASp.Net MVC3? Pin
Brij15-Nov-11 1:24
mentorBrij15-Nov-11 1:24 
GeneralRe: Is there any design pattren for authentication in ASp.Net MVC3? Pin
wasimsharp15-Nov-11 1:33
wasimsharp15-Nov-11 1:33 
QuestionWHAT IS SILVERLIGHT. Pin
Shubham Vijay14-Nov-11 21:10
Shubham Vijay14-Nov-11 21:10 
AnswerRe: WHAT IS SILVERLIGHT. PinPopular
thatraja14-Nov-11 21:37
professionalthatraja14-Nov-11 21:37 
QuestionProblem in playing videos on intranet portal Pin
uspatel13-Nov-11 22:34
professionaluspatel13-Nov-11 22:34 
AnswerRe: Problem in playing videos on intranet portal Pin
jkirkerx15-Nov-11 18:59
professionaljkirkerx15-Nov-11 18:59 
GeneralRe: Problem in playing videos on intranet portal Pin
uspatel15-Nov-11 19:31
professionaluspatel15-Nov-11 19:31 
QuestionURL and Routing problems - MVC model Pin
quanvt13-Nov-11 22:08
quanvt13-Nov-11 22:08 
Hi, everyone. I'm newbie in ASP.NET MVC framework. I've read "Pro asp.net MVC framework" and done a tutorial in this book. But i have problems with route table.

When i run application, the url: http://local:3425 listed some information in the page 1. But when i typed url: "http://local:3425/Page2", it got the error " Server Error in '/' Application.The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Page2"

Thanks in advance for any help.

Here it's the file Global.asax.cs

public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
null, // Don't bother giving this route entry a name
"", // Matches the root URL, i.e. ~/
new { controller = "Products", action = "List", page = 1 } // Defaults
);

routes.MapRoute(
null, // Don't bother giving this route entry a name
"{controller}/{page}", // URL pattern, e.g. ~/Page683
new { controller = "Products", action = "Act" }, // Defaults
new { page = @"\d+" } // Constraints: page must be numerical
);

//routes.MapRoute(null, "{controller}/{action}");
}

protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory());
}
}

And file Controller:

public class ProductsController : Controller
{
private IProductsRepository productsRepository;
public int PageSize = 2;

public ProductsController(IProductsRepository productsRepository)
{
this.productsRepository = productsRepository;
}

public ViewResult List(int page)
{
int numProducts = productsRepository.Products.Count();
ViewData["TotalPages"] = (int)Math.Ceiling((double)numProducts / PageSize);
ViewData["CurrentPage"] = page;
return View(productsRepository.Products
.Skip((page - 1) * PageSize)
.Take(PageSize)
.ToList());
}
AnswerRe: URL and Routing problems - MVC model Pin
Not Active13-Nov-11 22:43
mentorNot Active13-Nov-11 22:43 
QuestionError using Eval in asp.net Pin
Vimalsoft(Pty) Ltd13-Nov-11 20:50
professionalVimalsoft(Pty) Ltd13-Nov-11 20:50 
AnswerRe: Error using Eval in asp.net Pin
Anuj Banka13-Nov-11 21:16
Anuj Banka13-Nov-11 21:16 
QuestionDeveloping Employee Portal - Database design question. Pin
Sunil Kokkiligadda13-Nov-11 17:34
Sunil Kokkiligadda13-Nov-11 17:34 

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.