Click here to Skip to main content
16,004,778 members

Comments by Far sh (Top 9 by date)

Far sh 29-Feb-12 2:16am View    
thanks for the reply.
as i mentioned i have used FindControl method based on dynamic table name:

TextBox tempTextboxLv = (TextBox)Table_Lv_ItemTemplate.FindControl("td_EditTemp2_5");

and also based on the listview name:

TextBox tempTextboxLv = (TextBox)lv_Uc_Module.FindControl("td_EditTemp2_5");

but still does not work.
i would appreciate if you can provide me some sample based on this situation.
thanks
Far sh 24-Feb-12 2:24am View    
Hi Bojjiaiah,
thanks for your answer.
actually my user control page is inside an updatepanel in my aspx page as below:

<asp:UpdatePanel ID="upn_ModuleContent" runat="server" UpdateMode="Conditional">
<contenttemplate>

<asp:uc_Module_Temp ID="uc_Module_Temp1" runat="server" Visible="false" />


<Triggers>
<asp:AsyncPostBackTrigger ControlID="btn_Home" EventName="Click" />
</Triggers>



based on what you mentioned i have tried:

foreach (Control c in MTMainForm.Controls)
{
if (c.GetType().Name.ToLower() == "uc_Module_Temp_ascx")
{
UserControl uc = (UserControl)c;

TextBox txt = (TextBox)uc.FindControl("tb2_AddModule");
Response.Write("Controlvalue: " + txt.Text + "</br>");
}
}

and also:

foreach (Control c in MTMainForm.Controls)
{
if (c.GetType().Name.ToLower() == "uc_Module_Temp1")
{
UserControl uc = (UserControl)c;

TextBox txt = (TextBox)uc.FindControl("tb2_AddModule");
Response.Write("Controlvalue: " + txt.Text + "</br>");
}
}

but still can not access to the textbox of my usercontrol page...
any other option or did i missed something?
thanks
Far sh 15-Dec-11 21:15pm View    
Thank Morteza for reply.
the updatepanel is in aspx page and the labels, textbox and all content is located at the usercontrol page. i have fixed it.
please check out the answer.
but for editing part i have done some thing like what you have mentioned and using itemDataBound function of listview.

protected void lvProduct_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
Label EmpIDLabel = (Label)e.Item.FindControl("EmpIDLabel");
System.Data.DataRowView rowView = e.Item.DataItem as System.Data.DataRowView;
EmpIDLabel.Text = rowView["EmpID"].ToString();
}
}

regards
Far sh 13-Dec-11 4:04am View    
thanks for the reply, but could you please show me how to build the property for the fieldset in ascx.cs page and in the aspx.cs page change the visibility of the fieldset to false or true. because i could do it for the panel:

Control panelControl31 = WebUserControl31.FindControl("Panel1");
Panel pControl1 = (Panel)panelControl31;
pControl1.Visible = false;

but i couldn't do it for the fieldset inside the panel.
really appreciate.
Far sh 5-Dec-11 4:59am View    
in my template i have 3 parts which include partial refreshing using update panel. my emphasis is on the 3rd panel which suppose to load different aspx page. i couldn't find the way when the user click on 2nd panel that is containing the sub menu, it should refresh the 3rd panel and show the new aspx page. preferably i don't want to use the iframe. is there other way to overcome this issue? Thanks&Regards