TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ekrem Tapan
NA
967
81.7k
how can i keep my user control ?
Oct 17 2016 1:48 AM
Hi everyone
this is my page load code then when i wantto edit my data
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!
this
.IsPostBack)
{ DataTable dtAttach = Donate.GetMatDonationAttach(SID);
{
if
(dtAttach.Rows.Count > 0)
{
for
(
int
i = 0; i <= dtAttach.Rows.Count - 1; i++)
{
Control tempControl =
this
.Page.LoadControl(
"UC/UC.ascx"
);
((ASP.sysadmin_credit_donationmaterial_uc_uc_ascx)tempControl).EquipmentName = dtAttach.Rows[i][
"ObjName"
].ToString();
((ASP.sysadmin_credit_donationmaterial_uc_uc_ascx)tempControl).Quantity = dtAttach.Rows[i][
"Quantity"
].ToString();
((ASP.sysadmin_credit_donationmaterial_uc_uc_ascx)tempControl).UnitPrice = dtAttach.Rows[i][
"UnitPrice"
].ToString();
attachSID = Convert.ToInt32(dtAttach.Rows[i][
"SID1"
].ToString());
pHolder.Controls.Add(tempControl);
}
}
}
}
}
then add another usercontrol on my page, but loaded data automatically remove on the my page
this is my adding user control button
protected
void
btnAdd_Click(
object
sender, EventArgs e)
{
for
(
int
i = count; i <= _block.Count; i++)
{
if
(!
this
._block[i].Visible)
{
this
._block[i].Visible =
true
;
break
;
}
}
}
how can i resolve when i add new usercontrol then keep old usercontrol and data ??
Reply
Answers (
1
)
Insert datetime into databse
why .net web api support ony Http not tcp?