<a href="http://localhost:53897/SubmitAdd.aspx">
This site can’t be reached The connection was reset. Try: Reloading the page Checking the connection
Checking the proxy and the firewall ERR_CONNECTION_RESET
protected void Page_Load(object sender, EventArgs e) { //if (IsPostBack) //{ // int a=0; //} //if (Session["UserIsLogged"] == null) //{ // Response.Redirect("Login.aspx"); //} //if (!IsPostBack) //{ // BindStates(); //} } protected void btnSubmitAd_Click(object sender, EventArgs e) { string imageName = fileUploadImage.FileName; if(!(imageName.EndsWith(".png") || imageName.EndsWith(".jpg") || imageName.EndsWith(".jpeg"))) { lblerrorMesssage.Text = "Image should be of type .jpeg,.jpg,.png only"; return; } string im="AdImages/" + imageName; SubmitAdDetail SubmitAdObject = new SubmitAdDetail(); if (System.IO.File.Exists(Server.MapPath("AdImages/" + imageName))) { string newImageName = DateTime.Now.ToString("yyMMddHHmmss") + imageName; fileUploadImage.SaveAs(Server.MapPath("AdImages/" + newImageName)); SubmitAdObject.imageName = newImageName; } else { fileUploadImage.SaveAs(Server.MapPath("AdImages/" + imageName)); SubmitAdObject.imageName = imageName; } SubmitAdObject.adTitle = txtBoxTitle.Text; SubmitAdObject.type = Convert.ToInt32(rblType.SelectedValue.ToString()); SubmitAdObject.furnishingType = Convert.ToInt32(rblFurnishing.SelectedValue.ToString()); SubmitAdObject.dealType = Convert.ToInt32(rblDeal.SelectedValue.ToString()); SubmitAdObject.price = Convert.ToInt32(txtBoxPrice.Text.ToString()); SubmitAdObject.address = txtBoxAddress.Text; SubmitAdObject.city = Convert.ToInt32(ddlCity.SelectedValue.ToString()); SubmitAdObject.mobile = txtMobile.Text; SubmitAdObject.name = txtBoxName.Text; SubmitAdObject.rooms = Convert.ToInt32(rblRooms.SelectedValue.ToString()); SubmitAdObject.state = Convert.ToInt32(ddlState.SelectedValue.ToString()); SubmitAdObject.stateName = ddlState.SelectedItem.Text.ToString(); SubmitAdObject.cityName = ddlCity.SelectedItem.ToString(); if (SubmitAdDAL.SubmitAd(SubmitAdObject)) { } else { } } public void BindStates() { SqlConnection conn = CreateConnection.MakeConnectionToAHStateManagement(); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = "GetStates"; cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter stateAdapter = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); stateAdapter.Fill(ds); ddlState.DataSource = ds; ddlState.DataTextField="StateName"; ddlState.DataValueField = "StateID"; ddlState.DataBind(); ddlState.Items.Insert(0, new ListItem("Select State", "0")); ddlState.SelectedIndex = 0; }
<a id="btnSubmitAd" onserverclick="btnSubmitAd_Click" runat="server" >
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)