Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Asp.net best webmodel?

Asp.net best webmodel?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdesignhelpquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    percyvimal
    wrote on last edited by
    #1

    Hello I need to create a Single Page based website ie user will only see Default.aspx when they click any menus. If user click a Menu item then i will pass a value to hidden form field and then submit the page and when the page reloads based on that form value i will load the body of that page. Inorder to achieve this 1. I have a MasterPage which contains the Menus footers and other general objects that is common to whole project. 2.In my project i have 2 sections one i call a.) Top Section and another i call b.) Bottom Section.I have divided those into 2 sections becuase i have included both sections in a seperate IFRAMES so that each section work independently of other,but both are related by menu and have same module based information. Page MENU <Iframe BottomSection> FOOTER Developement Language: VISUALBASIC.NET 2005/APS.NET 2.0 Required Information: I like to know the best method that can be implemented to design the structure of this website? Thanks in advance for your help With Regards Help in need is the help indeed</x-turndown>

    M I 2 Replies Last reply
    0
    • P percyvimal

      Hello I need to create a Single Page based website ie user will only see Default.aspx when they click any menus. If user click a Menu item then i will pass a value to hidden form field and then submit the page and when the page reloads based on that form value i will load the body of that page. Inorder to achieve this 1. I have a MasterPage which contains the Menus footers and other general objects that is common to whole project. 2.In my project i have 2 sections one i call a.) Top Section and another i call b.) Bottom Section.I have divided those into 2 sections becuase i have included both sections in a seperate IFRAMES so that each section work independently of other,but both are related by menu and have same module based information. Page MENU <Iframe BottomSection> FOOTER Developement Language: VISUALBASIC.NET 2005/APS.NET 2.0 Required Information: I like to know the best method that can be implemented to design the structure of this website? Thanks in advance for your help With Regards Help in need is the help indeed</x-turndown>

      M Offline
      M Offline
      munklefish
      wrote on last edited by
      #2

      Create all your components / pages as methods. That way you can just load up the required methods required based upon the data you pass in the querystring. E.G. On Page_Load simply run a Switch statement to determine which methods to run. To get data from querystring: category = Request.QueryString["cat"]; munklefish

      P 1 Reply Last reply
      0
      • M munklefish

        Create all your components / pages as methods. That way you can just load up the required methods required based upon the data you pass in the querystring. E.G. On Page_Load simply run a Switch statement to determine which methods to run. To get data from querystring: category = Request.QueryString["cat"]; munklefish

        P Offline
        P Offline
        percyvimal
        wrote on last edited by
        #3

        Thank you very much for the reply. I didnt able to understand your logic of using methods. Is it possible for you to provide a sample code to select 2 different method for 2 different querystring values? Regards Help in need is the help indeed

        M 1 Reply Last reply
        0
        • P percyvimal

          Thank you very much for the reply. I didnt able to understand your logic of using methods. Is it possible for you to provide a sample code to select 2 different method for 2 different querystring values? Regards Help in need is the help indeed

          M Offline
          M Offline
          munklefish
          wrote on last edited by
          #4

          Ok, Simply create everything in modules / methods private void page1() { //add code for page 1 } private void page2() { //add code for page 2 } Ok, with me so far? each page is in its own method. Then choose which method to run based upon the querystring: private void getQuery() { category = Request.QueryString["cat"]; } SO here were getting the category from the querystring and saving it as a variable named category. Next we need to call this method on page load. So simply add: getQuery(); to the Page_Load event. Next we need to choose which page to load based on the category: private void whichPage(string page) { switch(page) { case "page1": { //get page 1 page1(); break; } case "page2": { //get page2 page2(); break; } } } That code gets the value of the category variable and compares it to all the options / case: and then calls the method we need to open. So to call up this switch method we need to add it to the Page_load event after we have grabbed the querystring. So your Page_Load event should look like this: //get query getQuery(); //get page info whichPage(category); That should do the job! munklefish

          P 1 Reply Last reply
          0
          • M munklefish

            Ok, Simply create everything in modules / methods private void page1() { //add code for page 1 } private void page2() { //add code for page 2 } Ok, with me so far? each page is in its own method. Then choose which method to run based upon the querystring: private void getQuery() { category = Request.QueryString["cat"]; } SO here were getting the category from the querystring and saving it as a variable named category. Next we need to call this method on page load. So simply add: getQuery(); to the Page_Load event. Next we need to choose which page to load based on the category: private void whichPage(string page) { switch(page) { case "page1": { //get page 1 page1(); break; } case "page2": { //get page2 page2(); break; } } } That code gets the value of the category variable and compares it to all the options / case: and then calls the method we need to open. So to call up this switch method we need to add it to the Page_load event after we have grabbed the querystring. So your Page_Load event should look like this: //get query getQuery(); //get page info whichPage(category); That should do the job! munklefish

            P Offline
            P Offline
            percyvimal
            wrote on last edited by
            #5

            Thank you munklefish. Let me try your idea. With regards Help in need is the help indeed

            1 Reply Last reply
            0
            • P percyvimal

              Hello I need to create a Single Page based website ie user will only see Default.aspx when they click any menus. If user click a Menu item then i will pass a value to hidden form field and then submit the page and when the page reloads based on that form value i will load the body of that page. Inorder to achieve this 1. I have a MasterPage which contains the Menus footers and other general objects that is common to whole project. 2.In my project i have 2 sections one i call a.) Top Section and another i call b.) Bottom Section.I have divided those into 2 sections becuase i have included both sections in a seperate IFRAMES so that each section work independently of other,but both are related by menu and have same module based information. Page MENU <Iframe BottomSection> FOOTER Developement Language: VISUALBASIC.NET 2005/APS.NET 2.0 Required Information: I like to know the best method that can be implemented to design the structure of this website? Thanks in advance for your help With Regards Help in need is the help indeed</x-turndown>

              I Offline
              I Offline
              Ista
              wrote on last edited by
              #6

              It would be easiest to just Make them Web User Controls and an include the apprpriate ones. They can be added the Page.LoadTemplate() at runtime. 1 line of code equals many bugs. So don't write any!!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups