2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by canterorist
0

Use Request collection.

C#

String value1=Request["a"];
  String value2=Request["b"]

VB.NET

Dim value1=Request("a")
Dim value2=Request("b")
0

it means that in asp.net you can also use this code

<a href="hello.php?a=1&b=2">hello</a>

and this code

1.
      String value1=Request["a"];
   2.
      String value2=Request["b"]

will catch the value of a and b. Am i right?

0

Requested page must be .aspx

<a href="hello.aspx?a=1&b=2">hello</a>

hello.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 <%
     String v1 = Request["a"];
     String v2 = Request["b"];

     Response.Write("<br/>" + v1 + " " + v2);
     
  %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <a href="hello.aspx?a=1&b=2">Hello</a>  
    </div>
    </form>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.