locked
Dynamic Web Pages RRS feed

  • Question

  • I am a C++ and a C# fan. I have all the basic Microsoft software's on me . I also possess some HTML (as well as HTML5) knowledge together with CSS (CSS3). I am able to do basic static websites with minimal problems. I have done one or two web apps using C# and HTML. MS SQL is also not a problem for me, and i m able to link DBs to Apps.

    Now i would like to do basic dynamic websites using the MS Suite including Ms SQL Server. My main requirements are as follows:

    1. There has to be a user with admin access.
    2. Regular registered users can post to the site; but the content will be available once the admin approves
    3. Recording the number of hits the page gets
    4. If there are random advertisement on the panels, the admin should be able to know and get a report of how many times each advert appears in a particular timeframe.
    5. And all the rest of the basic things like, login page, nice GUI.

    I can manage #5 very well, but i m having trouble with #s 1-4.

    So my question is, what exactly do i need to start off. I know I have to learn, but before I learn, do i need any special software's. I have heard of Kentico, but is there any other way around. I would love to stick to ASP.NET (and C#)
    Monday, May 11, 2015 4:50 AM

Answers

  • First of all, this is not a direct c# question but an Asp.net question. 

    1- Creating different user levels is easy with asp.net

    You can use SQL and create a user table consisting username, email, userrole, and more(if you want) columns.

    In your controllers, you can check userrole before you are giving permisson to the user to view the content or redirect it to an error page. 

    2- For posting you can again use a controller. In your view, add a form and in that form, bind your form to the controller method. You should have a model that contains user post values such as:

    public string Message {get; set;}
    public string User {get; set; }
    public DateTime MessagePostTime {get; set;}

    The model class important because you will use it in your view and use model binding to pass values into your controller. In your controller method, you will record those values into an appropriate table. 

    This table, most probably will contain: 

    - MessageBody

    - MessageDate

    - User

    - isApproved

    These messages later will be shown to the admin in a view to confirm or reject the message.

    3-  To keep record of hits on a specific page, either you can create your own counter by creating a table for that or you can install some kinda third party plugin into your page. 

    4- In order to keep track of advertisement shown on a page you need to create an advertisement table which will have necessary columns to track how many times they are shown and when and to which users. 

    For all of those you can use Asp.net

    For your database, you can use ORM(object related mapping). You can use Entity Frame work or Nhibernate or a different database framework or plain ADO commands in order to handle commands of your SQL tables.

    You can find resources for your question in this form:

    http://forums.asp.net/

    • Proposed as answer by Kristin Xie Tuesday, May 12, 2015 5:35 AM
    • Marked as answer by Just Karl Wednesday, May 20, 2015 8:16 PM
    Monday, May 11, 2015 7:10 AM

All replies

  • Hello, nairk007.

    This forum is for Microsoft Small Basic programming language.  But your question is about C++ or C#.  So, I will move this thread to an appropriate forum.

    Thanks.


    Nonki Takahashi

    Monday, May 11, 2015 6:42 AM
  • First of all, this is not a direct c# question but an Asp.net question. 

    1- Creating different user levels is easy with asp.net

    You can use SQL and create a user table consisting username, email, userrole, and more(if you want) columns.

    In your controllers, you can check userrole before you are giving permisson to the user to view the content or redirect it to an error page. 

    2- For posting you can again use a controller. In your view, add a form and in that form, bind your form to the controller method. You should have a model that contains user post values such as:

    public string Message {get; set;}
    public string User {get; set; }
    public DateTime MessagePostTime {get; set;}

    The model class important because you will use it in your view and use model binding to pass values into your controller. In your controller method, you will record those values into an appropriate table. 

    This table, most probably will contain: 

    - MessageBody

    - MessageDate

    - User

    - isApproved

    These messages later will be shown to the admin in a view to confirm or reject the message.

    3-  To keep record of hits on a specific page, either you can create your own counter by creating a table for that or you can install some kinda third party plugin into your page. 

    4- In order to keep track of advertisement shown on a page you need to create an advertisement table which will have necessary columns to track how many times they are shown and when and to which users. 

    For all of those you can use Asp.net

    For your database, you can use ORM(object related mapping). You can use Entity Frame work or Nhibernate or a different database framework or plain ADO commands in order to handle commands of your SQL tables.

    You can find resources for your question in this form:

    http://forums.asp.net/

    • Proposed as answer by Kristin Xie Tuesday, May 12, 2015 5:35 AM
    • Marked as answer by Just Karl Wednesday, May 20, 2015 8:16 PM
    Monday, May 11, 2015 7:10 AM
  • @nairk007

    This forum is for C# code issues in specific. As Val10 said, your case related to Asp.Net should be posted in Asp.Net forum

    And you are more likely to get more efficient responses to ASP.NET issues at http://forums.asp.net where you can contact ASP.NET experts.

    Now I will move your thread to "Off-topic" forum. Thanks for your understanding.


    Have a nice day!

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, May 12, 2015 5:38 AM