public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ((Label)DataList1.Controls[0].FindControl("LblName")).Text = (Profile.Name).ToString(); ((Image)DataList1.Controls[0].FindControl("Image1")).ImageUrl = (Profile.ImageUrl).ToString(); (((TextBox)DataList1.Controls[0].FindControl("TxtItem")).Text) = (Profile.Item).ToString(); (((Label)DataList1.Controls[0].FindControl("LblPrice")).Text) = (Profile.Price).ToString(); Profile.Save(); } } protected void Button1_Click(object sender, EventArgs e) { Profile.Name= ((Label)DataList1.Controls[0].FindControl("LblName")).Text; Profile.ImageUrl = ((Image)DataList1.Controls[0].FindControl("Image1")).ImageUrl; Profile.Item = int.Parse(((TextBox)DataList1.Controls[0].FindControl("TxtItem")).Text); Profile.Price = int.Parse(((Label)DataList1.Controls[0].FindControl("LblPrice")).Text); string ProductID = (Request.QueryString["ProductID"]); Profile.Save(); } }
<connectionstrings> <add name="E-commerceConnectionString" connectionstring="Data Source=ps201\SQLEXPRESS;Initial Catalog=E-commerce;Integrated Security=True;User Id=Anoop Password=anoop@123;Pooling=False"> providerName="System.Data.SqlClient" /> </add></connectionstrings> <system.web> <authentication mode="Forms" /> <anonymousidentification enabled="true" /> <profile automaticsaveenabled="false"> <properties> <add name="Id" type="int" allowanonymous="true" /> <add name="Name" type="String" allowanonymous="true" /> <add name="ImageUrl" type="String" allowanonymous="true" /> <add name="Price" type="int" allowanonymous="true" /> <add name="Item" type="int" allowanonymous="true" /> </properties> </profile></system.web>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)