protected void ButtonImportData_Click(object sender, EventArgs e)
{
ClientScript.RegisterClientScriptBlock(typeof(string), "js", "test();", true);
string w = FileUpload3.FileName.ToString();
}在前台我有一个TEST()的函数现在能成功调用
我现在有个问题,能不能在JS函数执行完后再执行 :string w = FileUpload3.FileName.ToString();
这一句??
THX
{
ClientScript.RegisterClientScriptBlock(typeof(string), "js", "test();", true);
string w = FileUpload3.FileName.ToString();
}在前台我有一个TEST()的函数现在能成功调用
我现在有个问题,能不能在JS函数执行完后再执行 :string w = FileUpload3.FileName.ToString();
这一句??
THX
你可以在test()中用postback或者ajax等方式向后台提交数据,再另外处理。后台和前台的代码不可能交叉执行。
前后台分开执行。
test();或
this.ButtonImportData.Attributes.Add("click", "test();");
function test()
{
.......
}.cs文件:
protected void Page_Load(object sender, EventArgs e)
{
ButtonImportData.Attributes.Add("click", "test();");
} protected void ButtonImportData_Click(object sender, EventArgs e)
{
string w = FileUpload3.FileName.ToString();
}
先结贴,自己琢磨下