hi i m trying to connect the radiobutton list with the different view inside the multiview control. the first view is the bulletedlist second is the file upload and third is the url control. when i m running the following code the error "cannot implicitly convert type string to int"is coming.plz hep me solving this problem. my aspx code is
and my cs code is as-
the last line of the code has the error "cannot implicitly convert type string to int"
thank in advance
_______________ _______________ _______________ _______________ _____
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default17.aspx.cs" Inherits="Default17" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <style type="text/css"> #form1 { height: 350px; } </style> </head> <body> <form id="form1" runat="server"> <div style="height: 0px"> </div> <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" onselectedindexchanged="RadioButtonList1_SelectedIndexChanged" RepeatDirection="Horizontal" DataSourceID="XmlDataSource2" DataTextField="text" DataValueField="text"> <asp:ListItem Value="0">bulletedlist</asp:ListItem> <asp:ListItem Value="1">fileupload</asp:ListItem> <asp:ListItem Value="2">htmlcode</asp:ListItem> </asp:RadioButtonList> <asp:MultiView ID="MultiView1" runat="server"> <asp:View ID="View1" runat="server"> <asp:BulletedList ID="BulletedList1" runat="server" DataSourceID="XmlDataSource1" DataTextField="text" DataValueField="url" Font-Bold="True" Height="20px" Width="130px" DisplayMode="HyperLink"> <asp:ListItem>Microsoft</asp:ListItem> <asp:ListItem>Msdn</asp:ListItem> <asp:ListItem>asp.net</asp:ListItem> </asp:BulletedList> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"> </asp:XmlDataSource> </asp:View> <asp:View ID="View2" runat="server"> <p> <asp:FileUpload ID="FileUpload1" runat="server" /> </p> <p> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="upload" /> </p> <asp:HyperLink ID="HyperLink1" runat="server">HyperLink</asp:HyperLink> </asp:View> <asp:View ID="View3" runat="server"> <a href="kasdjlkajdsadaldkaskfhafafffffffffff.htm"> kasdjlkajdsadaldkaskfhafafffffffffff.htm</a> <a href = "good.htm">good.htm</a><br /> </asp:View> </asp:MultiView> </form> </body> </html>
Code:
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class Default17 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e ) { } protected void Button1_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { FileUpload1.SaveAs("C:\\Documents and Settings\\m.MM-4A6934257FDF\\My Documents\\Visual Studio 2008\\WebSites\\WebSite4\\uploadd" + FileUpload1.FileName); HyperLink1.Text = FileUpload1.FileName; HyperLink1.NavigateUrl = "uploadd" + FileUpload1.FileName; } } protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { MultiView1.ActiveViewIndex=RadioButtonList1.SelectedValue; } }
the last line of the code has the error "cannot implicitly convert type string to int"
thank in advance
_______________ _______________ _______________ _______________ _____
Comment