Page no refreshed Postback event

xiaoxiao2021-03-06  71

The TEXTBOX's onchange event will cause the page to refresh, which makes the input is very inconvenient, so I think the following solutions.

Idea: 1. Call the simple front script to open a new page, 2, pass the relevant parameters to the new page processing (the front and back of this new page can be processed), 3, the data obtained after processing, returns Opener, 4. The page that is opened automatically turns off after the data processing is complete. Code Example: The page to handle Send.aspx:

String windowattribs = "width = 10px," "height = 10px," "= ' " 10 " ") * 2) ', " " TOP = ' ( Screen.height " " 10 " ") * 2 '"

TextBox2.attributes ["onchange"] = "var aaa = this.Value; window.open ('open_xml.aspx? Get_id = textbox2 & get_value =' aaa, 'open_test', '" windowattrib s "" ";

TextBox3.attributes ["onchange"] = "var aaa = this.Value; window.open ('open_page.aspx? Get_id = textbox3 & get_value =' aaa, 'open_test', '" windowattribs "";

Open page open_page.aspx:

Private Void Page_Load (Object Sender, System.EventArgs E)

{

Object ls_o1 = request.QueryString ["get_id"]. TOSTRING ();

Object ls_o2 = Request.QueryString ["get_value"]. TOSTRING ();

IF (ls_o1! = null &&ls_o2! = NULL)

{

GET_ID.VALUE = (string) LS_O1;

Get_Value.Value = (string) LS_O2;

}

Send_Value_back ();

}

Private void send_value_back ()

{

IF (get_id.value! = "" && get_value.value! = NULL)

{

THIS.RESPONSE.WRITE ("