本文介绍了如何在下一个函数中使用值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
protected void rptGroupMember_ItemCommand( object source,RepeaterCommandEventArgs e)
{
string groupID = ;
switch (e.CommandName)
{
case 点击:
{
PopulateUserList(WorldEvolveModel.TherapistLevel.All.ToString() );
HiddenField hid =((LinkButton)e.CommandSource).FindControl( hfMessageGroupID) as HiddenField;
// 这里我得到了id。
groupID = hid.Value的ToString();
}
break ;
默认:
{
txtSearchMember.Text = 无法获取群组......;
}
break ;
}
}
// 获取所选成员的方法从弹出窗口中将它们保存在数据库中
受保护 void SaveSelectedGroupMember()
{
MessageGroupMemberDAL dal = new MessageGroupMemberDAL();
MessageGroupMemberModel model = new MessageGroupMemberModel();
MessageGroupDAL dalMG = new MessageGroupDAL();
string [] str = hfSelectedMembeID.Value.Split(' ,跨度>);
for ( int i = 0 ; i < str.Length; i ++)
{
/ / Get_UserProfiler(HttpContext.Current.User.Identity.Name);
model.GroupMemberID = 0 跨度>;
// 在第一个函数中我评论了code.that我在这里得到id.i想要用来代替3。
model.MessageGroupID = 3 ;
model.MemberID = Convert.ToInt32(str [i]);
model.MemberType = test;
dal.InsertUpdate_MessageGroupMembers(model);
}
}
我该怎么办...
plz帮助我...
解决方案
protected void rptGroupMember_ItemCommand(object source, RepeaterCommandEventArgs e) { string groupID = ""; switch (e.CommandName) { case "Click": { PopulateUserList(WorldEvolveModel.TherapistLevel.All.ToString()); HiddenField hid = ((LinkButton)e.CommandSource).FindControl("hfMessageGroupID") as HiddenField; //here i am getting the id. groupID = hid.Value.ToString(); } break; default: { txtSearchMember.Text = "Can't Get Groups..."; } break; } } //Method for get the selected member from popup and save them in database protected void SaveSelectedGroupMember() { MessageGroupMemberDAL dal = new MessageGroupMemberDAL(); MessageGroupMemberModel model = new MessageGroupMemberModel(); MessageGroupDAL dalMG = new MessageGroupDAL(); string[] str = hfSelectedMembeID.Value.Split(','); for (int i = 0; i < str.Length; i++) { //Get_UserProfiler(HttpContext.Current.User.Identity.Name); model.GroupMemberID = 0; //in first function i commented code.that i m getting id here.i want to use that is here in place of 3. model.MessageGroupID = 3; model.MemberID = Convert.ToInt32(str[i]); model.MemberType = "test"; dal.InsertUpdate_MessageGroupMembers(model); } }
how can i do this...
plz help me...
解决方案
这篇关于如何在下一个函数中使用值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!