如何将文本框控件值传递到common.cs文件的App_Code文件夹 [英] How to Pass the textbox control value to App_Code folder of common.cs file

查看:80
本文介绍了如何将文本框控件值传递到common.cs文件的App_Code文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上使用过ajax控件,我将在.aspx.cs文件中接收文本框的值,并且我想在common.cs文件的App_Code中重用相同的文本框值.我是.Net的新手,请让我知道该怎么做


预先感谢.

I have used ajax controls in my website , i will receive the value of the textbox in.aspx.cs file and i want reuse the same textbox value in App_Code of common.cs file. i m new to .Net , Please let me know how to do this


Thanks in advance.

推荐答案


将此代码写在common.cs文件中.

公共无效的GetTextBoxValue(string TextBoxValu)
{
//在此处执行所需的代码,并使用从aspx页面发送的TextBox值
}

并从.aspx.cs中将此方法调用为:

common com = new common();
com.GetTextBoxValue(TextBox1.Text);

希望对您有帮助.

Write this code in your common.cs file.

public void GetTextBoxValue(string TextBoxValu)
{
//do your required code here and use the TextBox value that is sent from aspx page
}

and call this method from .aspx.cs as:

common com=new common();
com.GetTextBoxValue(TextBox1.Text);

hope this will help you.


这篇关于如何将文本框控件值传递到common.cs文件的App_Code文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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