I have previously worked on windows applications in VB.NET & C#.NET but am new to ASP.NET
I have made a web page in my application where i have to call a function made in a separate class file on the click of the submit button
Here's what i tried:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim dl As DataLayer
dl.Product_Insert(pcode.Text, pname.Text, cat.Text, ptype.Text, comp.Text, desc.Text, dept.Text, qavail.Text, qsold.Text, qmin.Text, qpack.Text, Unit.Text, mrp.Text, disc.Text, prc.Text, spoff.Text, tax.Text)
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Add Product</title>
<style type="text/css">
#Submit
{
height: 40px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div align="center">
<div class="row">
<span class="label">Product Code:</span>
<span class="txt"><input type="text" id="pcode"/></span>
</div>
<div class="row">
<span class="label">Product Name:</span>
<span class="txt"><input type="text" id="pname"/></span>
</div>
<div class="row">
<span class="label">Product Category:</span>
<span class="txt"><input type="text" id="cat"/></span>
</div>
<div class="row">
<span class="label">Product Type:</span>
<span class="txt"><input type="text" id="ptype"/></span>
</div>
<div class="row">
<span class="label">Product Company:</span>
<span class="txt"><input type="text" id="comp"/></span>
</div>
<div class="row">
<span class="label">Product Description:</span>
<span class="txt"><input type="text" id="desc"/></span>
</div>
<div class="row">
<span class="label">Product Department:</span>
<span class="txt"><input type="text" id="dept"/></span>
</div>
<div class="row">
<span class="label">Quantity Available:</span>
<span class="txt"><input type="text" id="qavail"/></span>
</div>
<div class="row">
<span class="label">Quantity Sold:</span>
<span class="txt"><input type="text" id="qsold"/></span>
</div>
<div class="row">
<span class="label">Quantity Minimum Inventory:</span>
<span class="txt"><input type="text" id="qmin"/></span>
</div>
<div class="row">
<span class="label">Quantity Packing:</span>
<span class="txt"><input type="text" id="qpack"/></span>
</div>
<div class="row">
<span class="label">Product Unit:</span>
<span class="txt"><input type="text" id="unit"/></span>
</div>
<div class="row">
<span class="label">Product MRP:</span>
<span class="txt"><input type="text" id="mrp"/></span>
</div>
<div class="row">
<span class="label">Product Discount:</span>
<span class="txt"><input type="text" id="disc"/></span>
</div>
<div class="row">
<span class="label">Product Price:</span>
<span class="txt"><input type="text" id="prc"/></span>
</div>
<div class="row">
<span class="label">Product Special Offer:</span>
<span class="txt"><input type="text" id="spoff"/></span>
</div>
<div class="row">
<span class="label">Product Tax:</span>
<span class="txt"><input type="text" id="tax"/></span>
</div>
<asp:Button ID="Submit" runat="server" Text="OK" />
</div>
</form>
</body>
</html>
but it doesn't work.....
However, there is no problem in the Product_Insert function and the connection to the database is also properly made as i have made similar functions earlier in my windows applications. Since i am confident about that part, i did not deem it necessary to post my code of Product_Insert() here.
Although i would like to add that the Product_Insert() is in DataLayer.vb inside the App_Code folder of my project.
Could anyone suggest where i am going wrong?
I am sure there must be some elementary mistake or my approach must be wrong as this is the first ASP.NET application that i am designing...
In case my approach is wrong here, kindly guide me towards the correct way of doing what i want..
Any help will be greatly appreciated..
This post has been edited by aks29921: 22 November 2009 - 07:41 AM

New Topic/Question
Reply



MultiQuote





|