I've been getting an intermittent issue when i'm adding or using the telerik controls for tabstrip.
Here's what it looks like:
http://imgur.com/DYhXzNy
error creating control - telerik:RadTabStrip Duplicate component name 'RadTabStrip1'. Component names must be unique and case-insensitive.
What i've done:
Restarted VS
Uninstalled and reinstalled AJAX controls
Copied the Telerik.Web.UI bin file to my project's bin directory
All assemblies in web.config matches the current version of BIN i'm working on.
However, i'm still getting this issue more frequent than usual. It works again after clicking on the smart tag a couple of times or after restarting VS. recently, i had to keep on updating the BIN files and restart VS again to make it work. Also tried to clear VS cache but it keeps on happening. You guys have other suggestion on how i can permanently resolve this issue?
Update:
It happened again and seems to happen when try to follow the hierarchy w templates demo and do the following
Created a grid and included a nestedviewtemplate tag
made a radtabstrip inside the tag
placed one tab and added a multi page (used the smart tags at this point)
added a radlistview control. even added the placeholder tag.
Here's what i made after the tag
<telerik:RadMultiPage ID="RadMultiPage1" runat="server">
<telerik:RadPageView ID="RadPageView1" runat="server">
<telerik:RadListView ID="RadListView1" runat="server" ItemPlaceholderID="PlaceHolder1" DataKeyNames="JobOrderIndex" DataSourceID="SqlDataSource20">
<LayoutTemplate>
<div>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</div>
</LayoutTemplate>
<ItemTemplate>
<table>
<tr>
<td><i>Job Order No.</i>
</td>
<td>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("JobOrderNumber", "{0}") %>'></asp:Label>
</td>
<th>Status</th>
<th>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("JobOrderStatus", "{0}") %>'></asp:Label>
</th>
</tr>
<tr>
<td>Plate Number</td>
<td>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("ProfitCenter", "{0}") %>'></asp:Label>
</td>
<td>Job Type</td>
<td>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("JobType", "{0}") %>'></asp:Label>
</td>
</tr>
<tr>
<td>Job Order Date</td>
<td>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("JobOrderDate", "{0:d}") %>'></asp:Label>
</td>
<td>Created By</td>
<td>
<asp:Label ID="Label6" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>Problem Description</td>
<td colspan="3">
<asp:Label ID="Label7" runat="server" Text='<%# Eval("ProblemDescription", "{0}") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadListView>
So, i noticed that the error occurs as soon as i place the source for the RadListView control and certain other controls or smart tags for the grid or the tab will not show up.
If you notice that i'm not doing anything right (which is most of the time) please let me know and i would appreciate the wisdom you can share with me so it can be the Telerik master race i ought to be.
Thanks again,
C
I figured it out, I eventually added a control .aspx page and this error occurs when 2 controls with the same ID is found in one module.
Related
Here is my asp.net Repeater From within it there is a button. I want to get the value of lblFaulType in a string in code behind when i click Button1, How can I do that?I have tried many approaches but nothing working. Please give me your suggestions.
<asp:Repeater ID="RepterDetails" runat="server">
<HeaderTemplate>
<table style="border:1px solid #0000FF; width:500px" cellpadding="0">
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color:#EBEFF0">
<td>
<table style="background-color:#EBEFF0;border-top:1px dotted #df5015; width:500px" >
<tr>
<td >
<strong><asp:Label ID="Label18" runat="server" Text="Fault Category: " Font-Bold="true"/></strong>
<asp:Label ID="lblFaultType" runat="server" Text='<%#Eval("Fault Type") %>' Font-Bold="true"/>
</td>
<td >
<strong><asp:Label ID="Label19" runat="server" Text="Fault Description: " Font-Bold="true"/></strong>
<asp:Label ID="Label8" runat="server" Text='<%#Eval("Fault Description") %>' Font-Bold="true"/>
</td>
</tr>
<tr>
<td >
<strong><asp:Label ID="Label2" runat="server" Text="Building: " Font-Bold="true"/></strong>
<asp:Label ID="Label9" runat="server" Text='<%#Eval("Name") %>' Font-Bold="true"/>
</td>
<td >
<strong><asp:Label ID="Label3" runat="server" Text="Floor: " Font-Bold="true"/></strong>
<asp:Label ID="Label10" runat="server" Text='<%#Eval("FloorNo") %>' Font-Bold="true"/>
</td>
</tr>
<tr>
<td>
<strong><asp:Label ID="Label6" runat="server" Text="Room Number: " Font-Bold="true"/></strong>
<asp:Label ID="Label11" runat="server" Text='<%#Eval("RoomNumber") %>' Font-Bold="true"/>
</td>
</tr>
<tr>
<td ><strong><asp:Label ID="Label14" runat="server" Text="Created Time: " Font-Bold="true"/></strong> <asp:Label ID="lblUser" runat="server" Font-Bold="true" Text='<%#Eval("Time") %>'/></td>
<td ><strong><asp:Label ID="Label15" runat="server" Text="Created Date: " Font-Bold="true"/></strong><asp:Label ID="lblDate" runat="server" Font-Bold="true" Text='<%#Eval("Date") %>'/></td>
</tr>
<tr>
<td ><strong><asp:Label ID="Label16" runat="server" Text="Start Status: " Font-Bold="true"/></strong> <asp:Label ID="Label12" runat="server" Font-Bold="true" Text='<%#Eval("StartStatus") %>'/></td>
<td ><strong><asp:Label ID="Label17" runat="server" Text="Assign Status: " Font-Bold="true"/></strong> <asp:Label ID="Label13" runat="server" Font-Bold="true" Text='<%#Eval("AssignStatus") %>'/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td >
<asp:TextBox ID="lblComment" runat="server" style="color:#000000; font-weight: bold;" placeholder="Describe the fault here" Text='<%#Eval("Comment") %>' TextMode="MultiLine" Columns="70" Rows="6" Enabled="false"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" class="text-center"><asp:Button ID="Button1" runat="server" Text="Assing Fault" class="btn btn-success" OnClick="Button1_Click" /> </td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
We may need to see the CodeBehind for this page, and specifically the "Button1_Click" method (click event).
Now though, it appears as though you only have one of the labels with an ID of "lblFaultType" (maybe you misspelled that in your initial description. Each of the other labels all carry sequentially numbered IDs (e.g. ID="Label1", ID="Label2", ID="Label3", etc), and your ClickEvent (the Button1_Click method) will need to iterate through those items to know 'which' label you are attempting to obtain a value from.
Suggestion: It may be better to apply a ClickEvent on each of the particular labels since it will have the ID there with it (a JScript/JQuery solution).
This actually a GREAT question!
(in fact good interview question)
Why?
Because how.net works for a gridview, listview, or a repeater?
They are ALL very similar.
If one has failed to grasp the “most basic” event model in .net, then suggestions to use JavaScript, or all kinds of wild approaches will be suggested (and they would get a failing mark in answering this question).
When using data bound controls that repeat data, then you can set a special command to trigger the Itemcommand event.
The attribute setting is called “CommandName”.
There are built in commands – and the command you use is important. However, "just" setting command name to somthing of your liking is sufficient in most cases.
This will CAUSE the ItemCommand event will fire. And once that occures, then you have "itemIndex" to point to any given row in the repeater (or gridview, or listview, or form view - the list goes on!!!).
So, add this to your button:
<asp:Button ID="Button1" runat="server" Text="Assing Fault"
class="btn btn-success" OnClick="Button1_Click"
CommandName = "Select" CommandArgument = '<%#Eval("Fault Type") %>'/>
Now, the the ItemCommand event, you can do this:
Protected Sub RepterDetails_ItemCommand(source As Object, e As RepeaterCommandEventArgs) Handles Repeater1.ItemCommand
Debug.Print("item command")
Dim MyRow As RepeaterItem = e.Item
Dim h As Label = e.Item.FindControl("lblFaultType")
Debug.Print(h.Text)
End Sub
Of course, since we set the CommandArguemnt to pass the value we want, then of course you can also do this:
debug.print("Value of FaultType = " & e.CommandArgument)
So, be it a classic "data aware" control in .net? Well be it a listview, gridview, repeater, and MANY MORE, then use the built in "gift horse" features that of course expected this common need and solution.
And you can get the selected index into the repeater with this:
Debug.Print(e.Item.ItemIndex)
Thanks guys but i found the answer at https://youtu.be/Oltxy1sGIds
So i did it like this:
RepeaterItem item = (sender as Button).NamingContainer as RepeaterItem; string type = +(item.FindControl("lblFaultType") as Label).Text;
I've developed a site in Visual Studio and after deploying to Azure the first landing page does not populate the DataTable. After clicking any link all the SQL queries and DataTables & GridViews work fine.
The problem did not exist until I deployed to Azure.
Home.aspx content...
<asp:DataList ID="dlFeatured" runat="server" HorizontalAlign="Center" RepeatColumns="3" RepeatDirection="Horizontal">
<ItemTemplate>
<table style="width:100%; ">
<tr>
<td style="width:250px;">
<asp:Image ID="Image2" style="width:300px; height:300px;" runat="server" ImageUrl='<%# "Images/ProductImages/" + Eval("IMAGE") %>' />
</td>
</tr>
<tr>
<td class="text-center">
<h5 class="text-center" ><strong>
<asp:HyperLink ID="Label1" style="color:#782b42;" runat="server" NavigateUrl='<%# "ProductDetail.aspx?ID="+Eval("ID") %>' Text='<%# Eval("NAME") %>'></asp:HyperLink>
</strong></h5>
</td>
</tr>
<tr>
<td class="text-right">
$<asp:Label ID="Label2" runat="server" Text='<%# Eval("PRICE") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
CodeFile:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string id = Request.QueryString["ID"];
dlFeatured.DataSource = DataAccess.selectQuery("SELECT TOP 6 * FROM PRODUCTS WHERE FEATURED = 1 ORDER BY NEWID()");
dlFeatured.DataBind();
}
}
I have no idea where to even start. The site is live at https://wekeafurniture20190329101320.azurewebsites.net
The Azure Application service does not recognize the "Set As Start Page" setting in the Visual Studio project.
I had to get to the App Service resource, click on Application Settings, the modify the default documents setting.
I used ModalPopupExtender to popup a panel. In the panel I have a textbox. For that textbox's textchanged event i'm wrote some codes. But whenever focus come out of that textbox.
The popup is closing itself immediately. Can anyone say how to resolve this issue.
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="pnlEdit" runat="server" Width="100%"
DefaultButton="lnkbtnCancel">
<table id="tblEditUser">
<tr>
<td><asp:Label ID="Label1" runat="server" Text="E-mail:" CssClass="lblGray"></asp:Label></td>
<td colspan="2"><asp:TextBox ID="txtEmail" runat="server" AutoPostBack="true" ontextchanged="txtEmail_TextChanged" CssClass="txtDarkgray" Width="300px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:Label ID="Label2" runat="server" Text="Name:" CssClass="lblGray"></asp:Label></td>
<td><asp:Label ID="lblName" runat="server" CssClass="lblGray"></asp:Label></td>
</tr>
May you please post some code which you are doing.
I think this may help
write following code on text change event of textbox:
ModalPopUpExtenderName.Show();
Please revert if it does not help also mark as answer if it does help.
Happy Coding:)
I am working on a website where i need to search for items from database and display it in page.I am using Datalist for displaying all the items .Now i need to display all the items according to some category.For example if i search for a two-wheeler it may have many categories or manufacturer's.Now I want to display it separately according to the categories.I can use many datalist to do that,but it will slow down the site.Instead which control can i use to do this.I searched the web but got no idea.So please give me sugessions to go about it.Any sugessions will be appreciated.
Code:
<asp:DataList ID="Dlitems" runat="server" RepeatDirection="Horizontal" RepeatColumns="4"
CellPadding="0" CellSpacing="15">
<ItemTemplate>
<table>
<tr>
<td>
<asp:ImageButton ID="ImgbtnProductImage" CssClass="imgdisp" ImageUrl='<%# Eval("ImagePath") %>'
CommandArgument='<%#Eval("ProductCode") %>' runat="server" CommandName="cmdView" />
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td width="20px"></td>
<td>
<img src="../Database/images/inr.jpg" alt="addtocart" />
<asp:Label ID="lblproductprice" runat="server" Text='<%# Eval("Price") %>' CssClass="lbl" />
</td>
<td>
<asp:ImageButton ID="imgbtnaddtocart" runat="server" Height="25px" Width="25px" ImageUrl="~/Database/images/addtocart.JPG"
ToolTip="Add to Cart" CommandArgument='<%#Eval("ProductCode")+","+ Eval("ProductName")+","+ Eval("ImagePath")+","+ Eval("Price")+","+ Eval("LongDescription") %>'
CommandName="addtocart" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
You can take benefit of gridview.
Bind you gridview data.
And letter merge the rows.
For an example you can use the below link
http://www.codeproject.com/Articles/34337/How-to-merge-cells-with-equal-values-in-a-GridView
Edit 1
Some links
How to display group data separately using DataList in ASP.NET?
http://aspnettuts.wordpress.com/2010/10/21/asp-net-repeater-group-recordsdata-delete-selected-rows/
You should go for a Repeater control.
Example on Repeater
<asp:Repeater runat="server" ID="Repeater1">
<ItemTemplate>
<asp:ImageButton ID="ImgbtnProductImage" CssClass="imgdisp" ImageUrl='<%# Eval("ImagePathForTwoWheeler")%> + <%# Eval("ImagePathForCategory") %>'
CommandArgument='<%#Eval("ProductCode") %>' runat="server" CommandName="cmdView" />
</ItemTemplate>
</asp:Repeater>
i am trying to vertically align the table present in the panel but i cant and when i apply style properties to the table it does not work ? means there would be no effect of style property on it as my code is given below,
<asp:Panel ID="Panel1" runat="server"
style="z-index:0;left:250px;position:absolute;top:160px; height: 160px; padding:10"
BackColor="Green" Width="300px">
<div style="width: 295px; height: 155px;" align= "center">
<table style="height: 48px; width: 187px; margin-left:0px; min-height:14px; min-width:55px; vertical-align:bottom" align="center" bgcolor="green" >
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="UserName" ForeColor="White"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label3" runat="server" Text="Password" ForeColor="White"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox2" textmode="Password" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label4" runat="server" ForeColor="White"></asp:Label>
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Login" onclick="Button1_Click" />
</td>
</tr>
</table>
</div>
</asp:Panel>
Hopes for your suggestions
Vertical alignment of some content within parent container is always tricky if you don't know the height of the content. Solution is to have a wrapper div in between parent & content elements. Then have outer container with "display:table" and wrapper div with "display:table-cell" aligned vertically in middle. See this fiddle for the illustration: http://jsfiddle.net/myXL3/3/
For complete information on this approach, see this excellent article: http://www.jakpsatweb.cz/css/css-vertical-center-solution.html
The problem here is that you have the table within a div element. Adding vertical-align:middle to the div's style should work. This assumes that the div is always "higher" than the table (as in your code snippet).
(Also, you have margins in your table's style - they should be removed to make sure they are not interfering with the vertical alignment)