Asp.net best webmodel?
-
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>
-
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>
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 -
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"];
munklefishThank 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
-
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
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 -
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! munklefishThank you munklefish. Let me try your idea. With regards Help in need is the help indeed
-
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>