将文本框值转移到另一个页面 [英] transfer textbox value to another page

查看:139
本文介绍了将文本框值转移到另一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

asp.net和vb.nnet中的Ido搜索引擎
我执行所有代码,但搜索结果在同一页面中

我想将文本框的值放在另一个页面上,我考虑一下
会话可能有用,但是当我使用它时效果不佳.

我在vb页面中放入了behand页面,这是

textbox1.text = session."

和第二页(结果)

textbox2.text = session."


问候:doh:

hello

Ido search engine in asp.net & vb.nnet
i do all the code but the search result become in the same page

I want to take the value of the textbox and put itto another page , i think about it
session it maybe usefule , but when i used it not work well.

i put in vb page the behand page this

textbox1.text=session." "

and the second page (results)

textbox2.text=session." "


regards :doh:

推荐答案

以下链接将帮助您理解和使用会话.您可以使用会话轻松完成任务.

http://msdn.microsoft.com/en-us/library/ms178581.aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/ms972429.aspx [ ^ ]

希望这会有所帮助!
Following link will help you to understand and use sessions. You can achieve your task using sessions easily.

http://msdn.microsoft.com/en-us/library/ms178581.aspx[^]

http://msdn.microsoft.com/en-us/library/ms972429.aspx[^]

Hope this will help!


有多种方法可以做到这一点.根据要求和适合您的条件,选择任何一个.

这些都可以将价值转移到另一个页面.如果您知道,请在MSDN上阅读有关它们的信息.
1.会议
2. QueryStrings
3.应用程序变量
4. PreviousPage属性

关于您要执行的操作,分配会话的方式是错误的:
There are multiple ways to do that. Based on the requirement and what suits you, pick any one.

These all can do value transfer to another page. Read about them on MSDN if you arnt aware.
1. Sessions
2. QueryStrings
3. Application variables
4. PreviousPage property

About what you are trying to do, the way you have assigned the session is wrong:
meshosho写道:
meshosho wrote:

textbox1.text = session."

textbox1.text=session." "


第一页:
Session["someValue"]= textbox1.Text;
第二页:
textbox2.Text = Session["someValue"].ToString();

session 的MSDN链接已提供给您.


1st Page:
Session["someValue"]= textbox1.Text;
2nd Page:
textbox2.Text = Session["someValue"].ToString();

MSDN link for session is already provided to you.


您可以使用QueryString将值发送到另一页.

我一直都比较喜欢;

你怎么办;

正在发送页面

You can send value to the other page by using QueryString.

I prefering that alltime;

How can you do;

Sending page

< a hre f ="Example.aspx?Value=Hello World!">Click Me! < / a >



将会有价值的页面
将此代码页写在代码后面



The Page who gonna take value
Write this code pages codebehind

protected void Page_Load(object sender, EventArgs e)
{
    //Get the value.
    string Value = Request.QueryString["Value"].ToString();
    //Show the value.
    Response.Write("alert(''"+Value+"'');");
}


这篇关于将文本框值转移到另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆