Home > Net >  ASP.NET at the front desk background and instance guidance
ASP.NET at the front desk background and instance guidance

Time:10-16

 & lt; % @ Page Language="c #" AutoEventWireup="true" CodeFile="ChronicleOption. Aspx. Cs" Inherits="Chronicle_Chronicle % & gt;" 



<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;


<body>
The View Option




The backend:
 using System; 
Using System. Text. RegularExpressions;
Public partial class Chronicle_Chronicle: System. Web. UI. Page
{
Private readonly Regex _number=new Regex (@ "^ (\ +)? Piled \ d + $", RegexOptions.Com);
Protected void Page_Load (object sender, EventArgs e)
{
String Name_Server=Request [" SERVER_NAME "];
String CharacterId=Request [" CHAR_ID "];
String=TARGET_ID Request [" TARGET_ID "];
String SESSION_KEY=Request [" SESSION_KEY "];

If (string. IsNullOrEmpty (Name_Server) | | string. IsNullOrEmpty (CharacterId) | | string. IsNullOrEmpty TARGET_ID () | | string. IsNullOrEmpty (SESSION_KEY))
{
Response. Write (" Invalid parameter (1) ");
return;
}

if (! Regex. IsMatch (CharacterId, @ ^ "[0-9] {16} $"))
{
Response. Write (" Invalid parameter (2) ");
return;
}
String _viewAccount=DateBase. GetAccountForCharID (Name_Server, Convert ToInt64 (CharacterId));
If (DateBase. GetUserSession (_viewAccount)!=SESSION_KEY)
{
Response. Write (" Invalid parameter (3) ");
return;
}





}
}


Don't know how to pass parameters to the front desk, whether to have the instance can refer to? .

CodePudding user response:

Either you use asp.net controls, or written in response, either with ajax

CodePudding user response:

1/f, that will not go into here,
Feel the building or system to learn

CodePudding user response:

You can use the hidden fields to store

CodePudding user response:

 & lt; The form id="Form1" action="ChronicleOption. Aspx method=" Post "" name=" ChronicleOption & gt;" 

Then ask, here three hidden parameters are passed to the background?
When I trigger the submit ChronicleOption wear to the background. The parameters of the aspx have four, namely name_server, char_id, session_key and I choose Radio1, Radio2, Radio3 one?

CodePudding user response:

reference 5 floor qq_38399333 reply:
 & lt; The form id="Form1" action="ChronicleOption. Aspx method=" Post "" name=" ChronicleOption & gt;" 

Then ask, here three hidden parameters are passed to the background?
When I trigger the submit ChronicleOption wear to the background. The parameters of the aspx have four, namely name_server, char_id, session_key and I choose Radio1, Radio2, Radio3 one?

is
  • Related