473,511 Members | 10,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get method

30 New Member
How this looks in ASP C#?
Or how use get method in ASP C#?

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <p align="center">This text befor script. Don't change</p>
  6. <?php
  7. $id = $_GET['id'];
  8.  
  9.  
  10. if ($id == "") {
  11. ?>
  12. <p align="center">This index.<a href="index.php?id=news">Go to  news?</a></p>
  13. <?
  14. }
  15. if ($id == news) {
  16. ?>
  17. <p align="center"><a href="index.php?id=menu">Go to index.php?id=menu ?</a></p>
  18. <?
  19. }
  20. if ($id == menu) {
  21. ?>
  22. <p align="center"><a href="index.php">Ther is  "menu", go to index meniu?</a></p>
  23. <?
  24. }
  25. ?>
  26. <p align="center">This is under script. Don't change</p>
  27. </body>
  28. </html>
  29.  
Aug 15 '08 #1
6 1001
MSwaffer
2 New Member
There are a number of ways depending on how you want to do it.

Easiest way is to use the Request.Params collection like this:

string id = Request.Params["id"];

The Request.Params collection contains your QueryString, Form, Cookies and ServerVariables items and is the quick way to get both your Post and Get variables.
Aug 15 '08 #2
Curtis Rutland
3,256 Recognized Expert Specialist
Get is part of the Querystring, right?

You can use Request.QueryString["nameOfVar"];
Aug 15 '08 #3
Smurfas
30 New Member
Thanks, you help me ;]

But I have another problam.
How in C# use include? I have php example
Expand|Select|Wrap|Line Numbers
  1. if(isset($_GET['index'])) {
  2. include("news.php");
  3. } elseif(isset($_GET[2])) { 
  4. include("2.php");
  5. } else { 
  6. include("3.php");
  7.  
How this looks in C#? How use include?
I wont in page center insert another page.
Aug 17 '08 #4
Curtis Rutland
3,256 Recognized Expert Specialist
C# is not a scripting language. It doesn't work that way. As far as I know there is no equivalent for that. If you really want to include a page, you will have to do an HttpWebRequest and Response.Write the resulting html.
Aug 17 '08 #5
Smurfas
30 New Member
C# is not a scripting language. It doesn't work that way. As far as I know there is no equivalent for that. If you really want to include a page, you will have to do an HttpWebRequest and Response.Write the resulting html.
But how put many information in web site?
If I all information put in one page, very long load.

How make this site:
https://support.dell.com/

Top and footer allways same, but middle always different. Some includin page...
Maybe some have Idias?
Aug 17 '08 #6
Curtis Rutland
3,256 Recognized Expert Specialist
Look up a Master Page.

http://msdn.microsoft.com/en-us/library/wtxbf3hh.aspx

Master pages are exactly what you need.
Aug 17 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

11
3596
by: Dave Rahardja | last post by:
OK, so I've gotten into a philosophical disagreement with my colleague at work. He is a proponent of the Template Method pattern, i.e.: class foo { public: void bar() { do_bar(); } protected:...
5
15338
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
4
2889
by: daniel.w.gelder | last post by:
I wrote a template class that takes a function prototype and lets you store and call a C-level function, like this: inline string SampleFunction(int, bool) {..} functor<string (int, bool)>...
7
1733
by: greenflame | last post by:
I am trying to make a matrix object. I have given it some properites. I am trying to add a method. When I call the method by Test.showDims(...) I want to only enter one input, that is the method by...
5
4859
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
0
7148
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5673
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.