how to store data into database using text-area - asp.net

How to store data in the database.
it will show the following exception
Additional information: Procedure or function 'spUploadImage' expects parameter '#detail', which was not supplied.
Following is the Movies.aspx file contents :
<html>
<head>
<script>
var maxAmount = 250;
function textCounter(textField, showCountField) {
if (textField.value.length > maxAmount) {
textField.value = textField.value.substring(0, maxAmount);
} else {
showCountField.value = maxAmount - textField.value.length;
}
}
</script>
</head>
<body>
<center>
<asp:Label ID="label3" Text="Name of Movie: " runat="server"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="label4" Text="Details of Movie: " runat="server"></asp:Label><br />
<textarea id="txtCommentBox" name="txtCommentBox" rows="6" style="width:340px;" onKeyDown="textCounter(this.form.txtCommentBox,this.form.countDisplay);" onKeyUp="textCounter(this.form.txtCommentBox,this.form.countDisplay);"></textarea>
<br />
<input readonly type="text" name="countDisplay" size="3" maxlength="3" value="250"> Characters Remaining
<br />
<br />
<asp:Label ID="label2" Text="Select Image of Movie: " runat="server"></asp:Label>
<asp:FileUpload ID="FileUpload1" runat="server" />
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Upload" OnClick="Button1_Click" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<br />
<br />
<asp:HyperLink ID="HyperLink1" runat="server">View Uploaded Image</asp:HyperLink>
</center>
</body>
</html>
</asp:Content>
Following is the Movies.aspx.cs file contents :
public partial class Movies : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
Label1.Visible = false;
HyperLink1.Visible = false;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string txt = TextBox1.Text;
string text = Request.Form["txtCommentBox_1"];
HttpPostedFile postedFile= FileUpload1.PostedFile;
string fileName = Path.GetFileName(postedFile.FileName);
string fileExtension = Path.GetExtension(fileName);
int fileSize = postedFile.ContentLength;
if(fileExtension.ToLower()==".jpg" || fileExtension.ToLower()==".png" || fileExtension.ToLower()==".bmp" || fileExtension.ToLower()==".gif")
{
Stream stream= postedFile.InputStream;
BinaryReader binaryReader = new BinaryReader(stream);
byte[] bytes = binaryReader.ReadBytes((int)stream.Length);
string cs = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
using (SqlConnection con=new SqlConnection(cs))
{
SqlCommand cmd = new SqlCommand("spUploadImage",con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter paramName = new SqlParameter()
{
ParameterName = "#Name",
Value = fileName
};
cmd.Parameters.Add(paramName);
SqlParameter paramSize = new SqlParameter()
{
ParameterName = "#Size",
Value = fileSize
};
cmd.Parameters.Add(paramSize);
SqlParameter parammName = new SqlParameter()
{
ParameterName = "#mName",
Value = txt
};
cmd.Parameters.Add(parammName);
SqlParameter paramImageData = new SqlParameter()
{
ParameterName = "#ImageData",
Value = bytes
};
cmd.Parameters.Add(paramImageData);
SqlParameter paramdetail = new SqlParameter()
{
ParameterName = "#detail",
Value = text
};
cmd.Parameters.Add(paramdetail);
SqlParameter paramNewId = new SqlParameter()
{
ParameterName = "#NewId",
Value = -1,
Direction=ParameterDirection.Output
};
cmd.Parameters.Add(paramNewId);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Label1.Visible = true;
Label1.Text = "Upload Successful";
Label1.ForeColor = System.Drawing.Color.Green;
HyperLink1.Visible = true;
HyperLink1.NavigateUrl = "~/Moviesimg.aspx?Id="+cmd.Parameters["#NewId"].Value.ToString();
}
}
else
{
Label1.Visible = true;
Label1.Text = "Only Images (.jpg, .png, .gif and .bmp) can be uploaded...";
Label1.ForeColor = System.Drawing.Color.Red;
HyperLink1.Visible = false;
}
}
}
and the stored procedure is as follows :
create proc spUploadImage
#Name nvarchar(255),
#Size int,
#ImageData varbinary(max),
#mName nvarchar(50),
#detail nvarchar(300),
#NewId int output
as
Begin
Insert into tblImages
values(#Name,#Size,#mName,#detail,#ImageData)
select #NewId = SCOPE_IDENTITY()
End
But I want to get a text from the text area and to store in the database.
but it raises an exception...

You are missing a form tag. Use an ASP control instead of a plain HTML control - all the other controls are ASP so be consistent.
<html>
<body>
<form id="form1" runat="server">
<asp:TextBox id="txtImagename1" TextMode="multiline" Columns="50"
Rows="1" runat="server" />
</form>
</body>
</html>
protected void Button1_Click(object sender, EventArgs e)
{
string text = Server.HtmlEncode(txtImagename1.Text);
...
}
The Request.Form collection cannot be used if your form is over 100 KB:
msdn.microsoft.com/en-us/library/ms525985(v=vs.90).aspx

If you are setting runat="server" to any control, in that case the control must be placed inside a form tag with runat="server" like following
<html>
<body>
<form id="form1" runat="server">
<center>
<textarea id="txtImagename1" name="txtImagename1" runat="server" rows="1" cols="50">
</textarea>
<br />
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Upload" OnClick="Button1_Click" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<br />
<br />
<asp:HyperLink ID="HyperLink1" runat="server">View Uploaded Image</asp:HyperLink>
</center>
</form>
</body>
</html>
To access this on server side you can simply use the the InnerText property of the TextArea as following.
txtImagename1.InnerText
If you want you can also access it using Form object also as following.
Request.Form["txtImagename1"]
For this the control can be simple TextArea without runat attribute.

Related

ASP.net gridview cant update image

So i'm a newbie in asp.net. I have this college project which need to use update function. I made the update function, its work fine for all columns except for picture's column. Its not updating picture database, and show the previous picture in the gridview. The pictures in the folder already updated but the gridview just show the previous picture (not the updated one). I need your help please thank you :)
this is the gridview aspx code, if update button was clicked, it will redirect to another page.
<div>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderText="Images" ItemStyle-Height="50px" ItemStyle-Width="50px" >
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("pic") %>'/>/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="nama" HeaderText="nama" />
<asp:BoundField DataField="harga" HeaderText="harga" />
<asp:BoundField DataField="stok" HeaderText="stok" />
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Update" wID='<%# Eval("Id") %>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
this is the Page_Load function
public List<Table> getAll()
{
List<Table> watches = (from x in de.Tables select x).ToList();
return watches;
}
public void loadData()
{
GridView1.DataSource = repo.getAll();
GridView1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack) loadData();
}
and redirected to update aspx
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<br />
<asp:FileUpload ID="pic" runat="server" />
<br />
<asp:TextBox ID="name" runat="server"></asp:TextBox>
<br />
<asp:TextBox ID="price" runat="server"></asp:TextBox>
<br />
<asp:TextBox ID="stok" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnUpdate" runat="server" Text="Button" OnClick="btnUpdate_Click" />
This is the update function of btnUpdate in update aspx
protected void btnUpdate_Click(object sender, EventArgs e)
{
string ext = System.IO.Path.GetExtension(pic.FileName);
string nama = name.Text;
int harga = Int32.Parse(price.Text);
int stock = Int32.Parse(stok.Text);
Table update = (Table)Session["updateWatch"];
string pict = "..\\Pictures\\Watch Pictures\\" + update.Id + ext;
bool updateStatus = repo.update(update.Id, pict, nama, harga, stock);
if (updateStatus == false) Label1.Text = "fail";
else
{
string subPic = update.pic.Substring(3);
string path = Server.MapPath("~") + subPic;
string savepath = Server.MapPath("~/Pictures/Watch Pictures/");
System.IO.File.Delete(path);
pic.SaveAs(savepath + update.Id + ext);
Response.Redirect("WebForm1.aspx");
}
}
this is the update function in repository
public bool update(int id, string pic, string nama, int harga, int stok)
{
Table updateW = (from x in de.Tables where x.Id == id select x).FirstOrDefault();
updateW.pic = pic;
updateW.nama = nama;
updateW.harga = harga;
updateW.stok = stok;
de.SaveChanges();
if (updateW == null) return false;
return true;
}
this is the code for gridview datasource
public List<Table> getAll()
{
List<Table> watches = (from x in de.Tables select x).ToList();
return watches;
}

Contact form send even if the field(s) are empty

Please help...
I just got the below code from the internet and don't know how to fix the issue.
Issue is:- even if the form is empty or one of the fields is empty, I still receive the email.
I think I need to add some validation here but I don't know how. I am not a programmer and new to asp.
Here is the code.
the ASPX is:
<%# Page Language="C#" AutoEventWireup="true" ValidateRequest = "false" CodeFile="contact.aspx.cs" Inherits="_Default" %>
<html>
<head runat="server">
</head>
<body>
<form id="form1" runat="server">
<div class="inp_title"><asp:Label ID="Label1" runat="server" Text="Name*" /></div>
<div>
<asp:TextBox ID="txtName" runat="server" ValidationGroup = "contact" CssClass="inp_h" /><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter your name." ControlToValidate = "txtName" Display="Dynamic" /></div>
<div class="inp_title"><asp:Label ID="Label2" runat="server" Text="Subject*" /></div>
<div>
<asp:TextBox ID="txtSubject" runat="server" /><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*" ControlToValidate = "txtSubject" Display="Dynamic" /></div>
<div class="inp_title"><asp:Label ID="Label3" runat="server" Text="Email Address*" /></div>
<div>
<asp:TextBox ID="txtEmail" runat="server" CssClass="inp_h" Display="Dynamic" /><br />
<asp:RegularExpressionValidator id="valRegEx" runat="server" ControlToValidate="txtEmail" ValidationExpression=".*#.*\..*" ErrorMessage="Please enter a valid email address." Display="Dynamic" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Please enter your email address." ControlToValidate = "txtEmail" />
</div>
<div class="inp_title-2"><asp:Label ID="Label4" runat="server" Text="Message*" /></div>
<div>
<asp:TextBox ID="txtBody" runat="server" TextMode = "MultiLine" CssClass="inp_h" Display="Dynamic" /><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Please enter your message." ControlToValidate = "txtBody" />
</div>
<div class="inp_h"><asp:FileUpload ID="FileUpload1" runat="server" /></div>
<asp:Button ID="btnSend" runat="server" Text="Send" OnClick="btnSend_Click" CssClass="form-buttons"/>
<asp:Label ID="lblMessage" runat="server" Text="" ForeColor = "Green" />
</form>
</body>
</html>
The code-behind is :
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSend_Click(object sender, EventArgs e)
{
MailMessage mm = new MailMessage("email1#domain.com", "email2#domain.com");
mm.Subject = txtSubject.Text;
mm.Body = "Name: " + txtName.Text + "<br /><br />Email: " + txtEmail.Text + "<br /><br />Message:<br />" + txtBody.Text;
if (FileUpload1.HasFile)
{
string FileName = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName) ;
mm.Attachments.Add(new Attachment(FileUpload1.PostedFile.InputStream, FileName));
}
mm.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.office365.com";
smtp.EnableSsl = true;
System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
NetworkCred.UserName = "email1#domain.com";
NetworkCred.Password = "emai1password";
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
smtp.Send(mm);
lblMessage.Text = "Email Sent Sucessfully.";
}
}
Here you go, this will not send the email if the fields have not been filled out if you're not using validation - otherwise just add 'causesvalidation=true' to your submit button as per the earlier answer
protected void btnSend_Click(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(txtName.Text) && !string.IsNullOrWhiteSpace(txtEmail.Text) && !string.IsNullOrWhiteSpace(txtBody.Text) )
{
MailMessage mm = new MailMessage("email1#domain.com", "email2#domain.com");
mm.Subject = txtSubject.Text;
mm.Body = "Name: " + txtName.Text + "<br /><br />Email: " + txtEmail.Text + "<br /><br />Message:<br />" + txtBody.Text;
if (FileUpload1.HasFile)
{
string FileName = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName) ;
mm.Attachments.Add(new Attachment(FileUpload1.PostedFile.InputStream, FileName));
}
mm.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.office365.com";
smtp.EnableSsl = true;
System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
NetworkCred.UserName = "email1#domain.com";
NetworkCred.Password = "emai1password";
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
smtp.Send(mm);
lblMessage.Text = "Email Sent Sucessfully.";
}
else
{
lblMessage.Text = "You need to fill in the fields.";
}
}
your problem is here :
<asp:Button ID="btnSend" runat="server" Text="Send" OnClick="btnSend_Click" CssClass="form-buttons"/>
use this instead : CausesValidation="true" in your button. This will validate your required field before post event is fired.
<asp:Button ID="btnSend" runat="server" Text="Send" OnClick="btnSend_Click" CssClass="form-buttons" CausesValidation="true"/>
You need to have a required field validator for the textbox
just use
CausesValidation="true"
inside your button control, this will validate your controls client side.
Like I said :
<asp:Button ... CausesValidation="true"/>
or you can validate it at server side too.

Why Image is not attached from database with AsyncFileUpload control in asp.net?

I am working with ajax AsyncFileUpload control. I have requirement where when user click on fileuploader and select the file from picture and immediately the picture will display on my image control I am using the following method
protected void fileUploadComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
string imagepath = Server.MapPath("~/Pics/");
string serverfilename = Path.GetFileName(AsyncFileUpload1.PostedFile.FileName);
string fullpath = Path.Combine(imagepath, serverfilename);
string path = "~/Pics/" + serverfilename;
//string filename = System.IO.Path.GetFileName(AsyncFileUpload1.FileName);
//string path = Server.MapPath("~/Pics/") + filename;
AsyncFileUpload1.SaveAs(fullpath);
// FileUpload1.PostedFile.SaveAs(path);
SqlCommand cmd = new SqlCommand("insert findfriend values('" + path + "','" + TextBox1.Text + "')", con);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
SqlCommand GetImage = new SqlCommand("select * from findfriend where name='" + TextBox1.Text + "'", con);
GetImage.CommandType = CommandType.Text;
SqlDataReader dr = GetImage.ExecuteReader();
dr.Read();
if (dr.HasRows)
{
Image1.ImageUrl = dr["picture"].ToString();
}
}
My aspx source
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
// This function will execute after file uploaded successfully
function uploadComplete() {
document.getElementById('<%=lblMsg.ClientID %>').innerHTML = "File Uploaded Successfully";
}
// This function will execute if file upload fails
function uploadError() {
document.getElementById('<%=lblMsg.ClientID %>').innerHTML = "File upload Failed.";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ajax:ToolkitScriptManager ID="scriptManager1" runat="server"/>
Your Name:
<asp:TextBox ID="TextBox1" runat="server" Width="223px"></asp:TextBox>
<br />
<br />
Upload Picture:<asp:FileUpload ID="FileUpload1" runat="server" />
<br />
<ajax:AsyncFileUpload ID="AsyncFileUpload1" OnClientUploadComplete="uploadComplete" OnClientUploadError="uploadError"
CompleteBackColor="White" Width="350px" runat="server" UploaderStyle="Modern" UploadingBackColor="#CCFFFF"
ThrobberID="imgLoad" OnUploadedComplete="fileUploadComplete" />
<asp:Label ID="lblMsg" runat="server" Text="Label"></asp:Label>
<br />
<br />
<asp:Image ID="Image1" runat="server" Height="295px" Width="338px" />
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Upload" />
<asp:Button ID="Button2" runat="server" onclick="Button2_Click"
Text="Button" />
<br />
<asp:Label ID="Label1" runat="server"></asp:Label>
</div>
</form>
</body>
</html>
Now the problem is this that my picture path is saving into database succesfully image is not binding with image control Experts tell me please where i am wrong
This is because you are trying to access full path i.e. Path from root level like C:/Folder1/Folder2; Which doesn't work in case of Website.
I am assuming Pic folder in Solution folder.
So path have to be something like
Image1.ImageUrl = #"Pic\logo.jpg";
Pic\logo.jpg"
is the value coming from your Database
You don't need to use absolute path using ~

asp DropDownList always select 0 index with postback check

i have aspx and aspx.cs files when i try to get the selected item of the
DropDownList
it always get the item at 0 index
<div style="text-align:center">
<b>Scegliere il nome del report * </b>
<asp:DropDownList id="dropdownlist1" style="width:250px;" runat="server"></asp:DropDownList>
<br />
<br />
<br />
<b>Scegliere la data del report </b>
<asp:TextBox runat="server" ID="txtSchedDate" name="txtSchedDate" type="text" cssclass="datebox" style="height:20px;" ReadOnly="true"/>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Pubblica" OnClientClick="" OnClick="Button1_Click" />
<br />
<br />
<br />
<br />
<asp:Label ID="Label1" Font-Names="Arial" Font-Size="15px" runat="server" ForeColor="Red" Font-Bold="True" Text=""></asp:Label>
<div id="divUpload" style="display:none">
<div style="width:200pt;;text-align:center;">Pubblicando...</div>
</div>
</div>
the c# code
protected double size = 1;
private string connectionString;
private OracleConnection connection;
private OracleCommand processNumQuery;
private int indexdropitem;
protected void Page_Load(object sender, EventArgs e)
{
if (Request["CONNECTSTRING"] == null && Session["CONNECTSTRING"] == null)
{
Response.Redirect("sessionup.asp?type=Pubreport");
}
else
{
if (Request["CONNECTSTRING"] != null)
{
connectionString = Request["CONNECTSTRING"].ToString();
}
else
{
connectionString = Session["CONNECTSTRING"].ToString();
}
if (connectionString.IndexOf("DSN=") >= 0)
{
Utility util = new Utility();
connectionString = util.ConnStr(connectionString);
}
Session["CONNECTSTRING"] = connectionString;
connection = new OracleConnection(connectionString);
connection.Open();
}
if (!IsPostBack)
{
processNumQuery = new OracleCommand("select distinct nome_report from rpg_notification",connection);
OracleDataReader reader = processNumQuery.ExecuteReader();
while (reader.Read())
{
dropdownlist1.Items.Insert(0, new ListItem(reader.GetString(0), ""));
}
reader.Close();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("try :" + dropdownlist1.SelectedIndex + " - " + txtSchedDate.Text + " - " + dropdownlist1.Items[dropdownlist1.SelectedIndex].Text + " - " + Request["txtSchedDate"] + " - ");
}
i awalys get the 0 index please what i have to do??
ASP.NET is not "smart" enough to pass the actual selected index of submitted drop down list. Instead, it depends on the browser sending the selected value, then depending on the items having different value.
If there are items with the same value and one of them is selected, the server side SelectedIndex will return the index of the first item having that value. I have just created a quick test and was proven right. (not familiar with any .NET fiddle, sorry)
In your specific case, all items had empty value due to that line:
dropdownlist1.Items.Insert(0, new ListItem(reader.GetString(0), ""));
To "fix" your problem just add a value:
string myValue = reader.GetString(0);
dropdownlist1.Items.Insert(0, new ListItem(myValue, myValue));
that should work...just for debuging proposes, try to call dropdownlist1.SelectedItem.Text instead of dropdownlist1.Items[dropdownlist1.SelectedIndex].Text and see what you get

Text not getting inserted into table, but only auto incrementing other column

I have multiple textboxes that goes into a table called dbo.skills
dbo.Skills SkillID (PK- AutoIncrement) | SkillName
So when I used this method, the name is not getting stored but only SkillID is getting auto-incremented. Here is my .cs code
public void InsertSkillInfo()
{
String KKStech = #"Data Source=USER-PC\SQLEXPRESS;Initial Catalog=KKSTech;Integrated Security=True";
SqlConnection conn = new SqlConnection(KKStech);
try
{
for (int i = 1; i <= 4; i++)
{
conn.Open();
//string skill = (TextBox)((Page.FindControl("TextBox" + i.ToString()))).Text;
var skill = "";
var control = Page.FindControl("TextBox" + i.ToString()) as TextBox;
if (control != null)
{
skill = control.Text;
}
const string sqlStatement = "INSERT INTO Skills (SkillName) VALUES (#SkillName)";
SqlCommand cmd = new SqlCommand(sqlStatement, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("#SkillName", skill);
cmd.ExecuteNonQuery();
conn.Close();
}
}
catch (System.Data.SqlClient.SqlException ex)
{
string msg = "Insert Error:";
msg += ex.Message;
throw new Exception(msg);
}
After entering values in textboxes, table looks like this-
Dbo.Skills
SkillID | SkillName
1 |
2 |
3 |
4 |
ASPX code:
<asp:Label ID="Label1" class="caption" runat="server" Text="Skill Name"></asp:Label>
<asp:TextBox ID="TextBox1" class="box" runat="server"></asp:TextBox> <br /> <br />
<asp:Label ID="Label2" class="caption" runat="server" Text="Skill Name"></asp:Label>
<asp:TextBox ID="TextBox2" class="box" runat="server"></asp:TextBox> <br /> <br />
<asp:Label ID="Label3" class="caption" runat="server" Text="Skill Name"></asp:Label>
<asp:TextBox ID="TextBox3" class="box" runat="server"></asp:TextBox> <br /> <br />
<asp:Button ID="Button1" class="box" runat="server" Text="Insert"
onclick="Button1_Click" /> <br /><br /><br />

Resources