how to bind imageurl of datalist to the image control which is out side of datalist on insert command
Date : March 29 2020, 07:55 AM
Any of those help I have a image coltrol out side of datalist, I want to assign the image url to this image control on insert command. imgThumb.ImageUrl="~/Controls/ShowImage.ashx?FileName=" +ImgName;
|
check/uncheck all checkbox of datalist on button click which is outside of datalist
Tag : chash , By : OllieDoodle
Date : March 29 2020, 07:55 AM
wish help you to fix your issue I hava a datalist in side that I have checkbox , I think, you must use jQuery. To check: $("#<%=btnCheckAll.ClientID %>").click(function() {
$("#<%= dlst1.ClientID %> input:checkbox").attr("checked", "checked");
});
$("#<%=btnUnCheckAll.ClientID %>").click(function() {
$("#<%= dlst1.ClientID %> input:checkbox").removeAttr("checked");
});
|
ASP.NET - Nested DataList, stored value from Parent in the Hidden Field in child DataList
Date : March 29 2020, 07:55 AM
I wish this help you Your hidden field is deep inside DataList-->Panel-->Child DataList. In this case you have to dig deeper: <asp:HiddenField ID="hiddenCompanyFromParent" runat="server" Value='<%# DataBinder.Eval(Container.Parent.Parent.Parent, "DataItem.Company")%> ' />
<asp:Panel ID="pnlChildView" runat="server" style="padding-left:200px;">
<asp:HiddenField ID="hdnCompany" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "Company")%> ' />
protected void childList_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
HiddenField hdnCompany = (HiddenField)e.Item.NamingContainer.Parent.FindControl("hdnCompany");
HiddenField hdnChildCompany = (HiddenField)e.Item.FindControl("hiddenCompanyFromParent");
if (hdnCompany != null && hdnChildCompany != null)
{
hdnChildCompany.Value = hdnCompany.Value;
}
}
}
|
How to check a condition only once on datalist DataList.ItemDataBound Event
Date : March 29 2020, 07:55 AM
this will help You could initialize a field in the class in Page_Load or the DataList's DataBinding event. Then you can access this field from ÌtemDataBound. protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int GroupID = BusinessLayer.Group_Table.GetByUniqName(Page.RouteData.Values["GroupName"].ToString());
GObject = new BusinessLayer.Group_Table(GroupID);
DataBindDataList(); // code that calls DataBind
}
}
private BusinessLayer.Group_Table GObject;
|
datalist is not working when appending row in table - in mozila
Date : March 29 2020, 07:55 AM
it should still fix some issue I am trying to add row dynamically when user clicks on add row button. My row contains some datalist cells also. but its not working. nothing get displayed in list. Please check and result image and help me to find the bug. , try this @kavi $('html, #addrow').live("Click",function(e) {
// alert("i am aa");
$('#tab_logic tr:last').after('<tr><td><input type="text" list="2" id="inpparameter" ><datalist id="2"><option value="TypeRating">TypeRating</option></td></tr>');
// add code here
});
|