如何使用scriptmanager弹出窗口显示弹出窗口中的用户名 [英] how to dispaly username in popup window using scriptmanager popup
问题描述
嗨frnds,
正在使用c#sqlserver 2005数据库在asp.net Gridview上工作。
这里正在更新记录,删除记录并使用gridview页脚文本框将记录添加到数据库中。
在更新,删除,添加记录后使用弹出消息。
我的要求是我要显示消息。
在Gridview First Column中我有字段作为用户名。
所以,我想显示一条消息
Suresh记录成功更新
这是我的代码消息弹出窗口。
ScriptManager.RegisterStartupScript(this,this.GetType(),RunCode,javascript:alert('已成功更新) ');,true);
所以我想在弹出框中添加用户名。
请帮忙。谢谢。
hi frnds,
am working on asp.net Gridview using c# sqlserver 2005 database.
here am updating records, deleting records and adding records into database using gridview footer textboxes.
am using popup message after updating , deleting , adding records.
My requirement is I want to display the message.
In Gridview First Column i have field as Username.
so, i want to display a message as
"Suresh record updated successfully"
This is my code message popup.
ScriptManager.RegisterStartupScript(this, this.GetType(), "RunCode", "javascript:alert('Updated successfully');", true);
So just i want to add username in popup box.
Please help. Thanks.
推荐答案
string s=username+"Record Updated successfully";
ScriptManager.RegisterStartupScript(this, this.GetType(), "RunCode", "javascript:alert('s');", true);
请参阅此处并尝试这样,
http:// stackoverflow.com/questions/14874005/show-pop-up-using-script-manager [ ^ ]
Refer here and try like this,
http://stackoverflow.com/questions/14874005/show-pop-up-using-script-manager[^]
And one more thing you people are missing double quote and + sign to write inside alert
string username=(gridview.row[0].Cells[0].Text).tostring();
string s=username+"Record Updated successfully";
ScriptManager.RegisterStartupScript(this, this.GetType(), "RunCode", "javascript:alert('"+s+"');", true);
这篇关于如何使用scriptmanager弹出窗口显示弹出窗口中的用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!