Sunday, 6 August 2023

Get Method in ASP.NET

Get Method in ASP.NET
  • The GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the "?" character.
  • The GET method produces a long string that appears in your server logs, in the browser's Location: box.
  • The GET method is restricted to send upto 1024 characters only.
  • Never use GET method if you have password or other sensitive information to be sent to the server.
  • GET can't be used to send binary data, like images or word documents, to the server.
  • The data sent by GET method can be accessed using QUERY_STRING environment variable.
  • The PHP provides GET associative array to access all the sent information using GET method.
 Try out following example by putting the source code in script.

GetMethod.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GetMethod.aspx.cs" Inherits="ShowDataOnePage2010.GetMethod" %>
 
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form method="get" action="GetMethod.aspx"> 
        User Name:<input id="txtuserName" type="text" name="UserName" /> 
        <br />
        Age:<input id="txtuserAge" type="text" name="UserAge" />
            <input id="btnSubmit" type="submit" value="Submit data using GET" /> 
        </form>
</body>
</html>
https://www.youtube.com/channel/UCKLRUr6U5OFeu7FLOpQ-FSw/videos

0 comments

Post a Comment