Click here to Skip to main content
15,888,111 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: need coding for my project Pin
jkirkerx28-Mar-13 10:09
professionaljkirkerx28-Mar-13 10:09 
QuestionDataTable: Query a programmatically generated DataTable Pin
Sumit Kathuria28-Mar-13 8:16
Sumit Kathuria28-Mar-13 8:16 
AnswerRe: DataTable: Query a programmatically generated DataTable Pin
David Mujica28-Mar-13 8:49
David Mujica28-Mar-13 8:49 
AnswerRe: DataTable: Query a programmatically generated DataTable Pin
mr.priyank29-Mar-13 4:26
mr.priyank29-Mar-13 4:26 
QuestionUsers can't get to my new web site Pin
Jim from Indy28-Mar-13 4:17
Jim from Indy28-Mar-13 4:17 
QuestionASP.net MVC 4 Panel visible true/false depends on the condition Pin
VishwaKL27-Mar-13 22:27
VishwaKL27-Mar-13 22:27 
AnswerRe: ASP.net MVC 4 Panel visible true/false depends on the condition Pin
Rohith Reddy Vadiyala28-Mar-13 21:16
Rohith Reddy Vadiyala28-Mar-13 21:16 
QuestionBest URL/File Structure Practices? Pin
Dralken27-Mar-13 19:28
Dralken27-Mar-13 19:28 
I'm pretty new to ASP.NET, building my first simple website using C#/RazorV2, hosting it on the free Windows Azure site.

I've found plenty of articles explaining how the URL structure works, and I've mostly got it figured out, but what I'm wondering is, what's the best/safest/most correct way of doing it?

Is it better to actually have multiple smaller files to handle things? Or is it "OK" or accepted to have one file handle several things?

For example, I'm building a simple blog web app, and right now I'm using single files to handle multiple sections, like I have a Blog.cshtml:
C#
if (urlDepth > 0) {
  renderPost = new List<BlogPost>();
    switch (UrlData[0]) {
      case "Post":
        int _postID = 0;
        _postID = Convert.ToInt32(UrlData[1]);
        renderPost.Add(blogRender.ShowSinglePost(_postID));
        Page.Title = renderPost[0].Name;
        break;
      case "Category":
        BlogCategory selCat = catDisplay.GetCategory(UrlData[1]);
        Page.Title = selCat.Name;
        renderPost = blogRender.PostsInCategory(selCat.ID);
        break;
    }
} else {
   renderPost = blogRender.MultiplePosts(10);
}

I know it's a bit crude as it is, but it's a work-in-progress, I plan on making it more failsafe as I go. But before I get too deep into it and possibly end up needing to tear it apart, would it be better to actually just make a folder named Blog, and have separate Post.cshtml and Category.cshtml files to handle their respective areas?

Figure it's best to know now so I can fix it if need be, rather than find out down the road that I messed up and have to try and pry apart the code.

If someone wants to see it in action to get a better idea of what I'm doing, it's currently at http://vouksh.azurewebsites.net/
AnswerRe: Best URL/File Structure Practices? Pin
Marco Bertschi28-Mar-13 9:12
protectorMarco Bertschi28-Mar-13 9:12 
AnswerRe: Best URL/File Structure Practices? Pin
Marco Bertschi28-Mar-13 9:13
protectorMarco Bertschi28-Mar-13 9:13 
Questionmodalpopupextender with dynamic checkboxlist Pin
janetb9926-Mar-13 6:29
janetb9926-Mar-13 6:29 
AnswerRe: modalpopupextender with dynamic checkboxlist Pin
janetb993-Apr-13 5:39
janetb993-Apr-13 5:39 
Questionhow to get selected item text in razor dropdownlist. Pin
GuhananthS24-Mar-13 20:12
GuhananthS24-Mar-13 20:12 
AnswerRe: how to get selected item text in razor dropdownlist. Pin
mr.priyank29-Mar-13 4:37
mr.priyank29-Mar-13 4:37 
QuestionHow to use databindings class in web application? Pin
behrad kiani24-Mar-13 8:33
behrad kiani24-Mar-13 8:33 
AnswerRe: How to use databindings class in web application? Pin
Marco Bertschi24-Mar-13 10:53
protectorMarco Bertschi24-Mar-13 10:53 
QuestionPing sql server database table and track inserted records Pin
Ani199124-Mar-13 6:03
Ani199124-Mar-13 6:03 
General70-487 Material Pin
silentspeaker24-Mar-13 3:39
silentspeaker24-Mar-13 3:39 
QuestionRe: 70-487 Material Pin
Richard MacCutchan24-Mar-13 4:32
mveRichard MacCutchan24-Mar-13 4:32 
Questionbooked dates should appear in red color in calender Pin
Member 870181324-Mar-13 3:09
Member 870181324-Mar-13 3:09 
AnswerRe: booked dates should appear in red color in calender Pin
Sandeep Mewara24-Mar-13 5:47
mveSandeep Mewara24-Mar-13 5:47 
GeneralRe: booked dates should appear in red color in calender Pin
Member 870181324-Mar-13 23:47
Member 870181324-Mar-13 23:47 
GeneralRe: booked dates should appear in red color in calender Pin
Member 870181325-Mar-13 7:57
Member 870181325-Mar-13 7:57 
QuestionCheckbox List help Pin
Girish_Sharma23-Mar-13 22:09
Girish_Sharma23-Mar-13 22:09 
Questionasp.net Pin
Member 992520623-Mar-13 12:20
Member 992520623-Mar-13 12:20 

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.