| | |
asp.net Label is an ambiguous reference
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2009
Posts: 16
Reputation:
Solved Threads: 0
hello i have one formview control n i want to retrive values from that n add save them in local variables
i get error while retriving values of labels :
Error 1 'Label' is an ambiguous reference between 'System.Web.UI.WebControls.Label' and 'System.Windows.Forms.Label'
n for double.Parse: like : "Input string was not in a correct format"
<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" Style="z-index: 100;
left: 210px; position: absolute; top: 173px" Width="299px" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" GridLines="Both" DataKeyNames="pcode">
<ItemTemplate>
pcode:
<asp:Label ID="pcodeLabel" runat="server" Text='<%# Eval("pcode") %>'></asp:Label><br />
<br />
pname:
<asp:Label ID="pnameLabel" runat="server" Text='<%# Eval("pname") %>'></asp:Label><br />
<br />
<asp:ImageButton ID="ImageButton1" runat="server" PostBackUrl='<%# Eval("purl","display.aspx?purl=items/{0}") %>' ImageUrl='<%# Eval("purl","items/{0}") %>' Height="30%" Width="30%" /> <br />
<br />
<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/icon/button_addtocart.gif" Width="60px" OnClick="ImageButton2_Click"/>
<br />
price:
<asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price", "{0:c}") %>'></asp:Label>
Rs.
</ItemTemplate>
<FooterTemplate>
<a href="ipods.aspx">Return to the main shop</a>
</FooterTemplate>
</asp:FormView>
this is .cs file code for imagebutton's click event:
protected void ImageButton2_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
string pname = ((Label)FormView1.FindControl("pnameLabel")).Text;
string price = ((Label)FormView1.FindControl("priceLabel")).Text;
double price = double.Parse(p.ToString());
}i get error while retriving values of labels :
Error 1 'Label' is an ambiguous reference between 'System.Web.UI.WebControls.Label' and 'System.Windows.Forms.Label'
n for double.Parse: like : "Input string was not in a correct format"
![]() |
Similar Threads
- Looking for Sr. ASP .NET Developers (Software Development Job Offers)
- ASP.NET/SQL Developer/Programmer (Web Development Job Offers)
- ASP.Net perm full time programmer wanted (Web Development Job Offers)
- Front-End Developer with ASP.net needed!!! (Web Development Job Offers)
- Experience ASP.net with C# developer needed!! (Web Development Job Offers)
- ASP.Net / C# Web Developer (Web Development Job Offers)
Other Threads in the ASP.NET Forum
- Previous Thread: Capital First letter
- Next Thread: need a small advice
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# c#gridviewcolumn cac checkbox click commonfunctions confirmationcodegeneration content courier css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dialog dropdownlist dynamically edit expose fileuploader fill flash formatdecimal forms formview gridview gudi homeedition iframe iis javascript jquery listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers






