-
Notifications
You must be signed in to change notification settings - Fork 1
/
Update.aspx
85 lines (78 loc) · 4.68 KB
/
Update.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<%@ Page Title="UpdateRecipe" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Update.aspx.cs" Inherits="Update" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
#txtDescription {
width: 304px;
}
.auto-style2 {
height: 96px;
}
</style>
</asp:Content>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder2" ID="Content3" runat="server">
<!-- <link href="css/master.css" rel="stylesheet" />-->
<link href="css/contact.css" rel="stylesheet" />
<link href="css/recipes.css" rel="stylesheet" />
<link rel="stylesheet" href="StyleSheet.css" />
<div id="recipesMain">
<label for="txtTitle">Recipe Title</label>
<asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ForeColor="Red" ErrorMessage="Please Add the Main Ingredient" ControlToValidate="txtTitle"></asp:RequiredFieldValidator>
<br />
<label for="txtCategory">Category</label>
<div>
<div>
<asp:TextBox ID="txtCategory" runat="server"></asp:TextBox>
</div>
<%--<asp:Label ID="lbl_msg_category" runat="server" Text=""></asp:Label>--%>
<%-- <asp:RequiredFieldValidator ID="RequiredFieldValidatortxtCategory" runat="server" ForeColor="Blue" ErrorMessage="Please Add the Category" ControlToValidate="txtCategory"></asp:RequiredFieldValidator>--%>
<br />
<label for="txtSubmitted">Submitted By</label>
<asp:TextBox ID="txtSubmitted" runat="server" Enabled="false"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ForeColor="Red" ErrorMessage="Please Add your Name" ControlToValidate="txtSubmitted"></asp:RequiredFieldValidator>
<br />
<label for="txtCookingTime">Cooking Time</label>
<asp:TextBox ID="txtCookingTime" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ForeColor="Red" ErrorMessage="Please Add Cooking Time" ControlToValidate="txtCookingTime"></asp:RequiredFieldValidator>
<br />
<label for="txtNumServ">Number of Servings</label>
<asp:TextBox ID="txtNumServ" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ForeColor="Red" ErrorMessage="Please Add Number of Serving" ControlToValidate="txtNumServ"></asp:RequiredFieldValidator>
<br />
<!-- Generate HTML for recipe_ingridient data.-->
<%if (moreIngridientList != null && moreIngridientList.Count > 0)
{ %>
<input type="hidden" id="hdnIngridient" name="hdnIngridient" value="<%=moreIngridientList.Count %>" />
<div id="divMoreIngridients">
<%for (int i = 0; i < moreIngridientList.Count; i++)
{ %>
<input type="hidden" id="hdnRecipeIngridientsId<%=(i+1) %>" name="hdnRecipeIngridientsId<%=(i+1) %>"
value="<%=moreIngridientList[i].recipe_ingredientsid %>" />
<div>
<label for="lblIngridients<%=(i+1) %>">Ingridients <%=(i+1) %></label>
<input name="txtIngridients<%=(i+1) %>" type="text" id="txtIngridients<%=(i+1) %>" value="<%=moreIngridientList[i].ingredientname %>">
</div>
<div>
<label for="txtQuantity<%=(i+1) %>">Quantity <%=(i+1) %></label>
<input name="txtQuantity<%=(i+1) %>" type="text" id="txtQuantity<%=(i+1) %>" value="<%=moreIngridientList[i].quantity %>">
</div>
<div>
<label for="ddlUnit<%=(i+1) %>">Unit <%=(i+1) %></label>
<select name="ddlUnit<%=(i+1) %>" id="ddlUnit<%=(i+1) %>">
<option value="">Select Unit</option>
<option value="Litre" <%=moreIngridientList[i].unit == "Litre" ? "selected" : "" %>>Litre</option>
<option value="Kgs" <%=moreIngridientList[i].unit == "Kgs" ? "selected" : "" %>>Kgs</option>
<option value="Grams" <%=moreIngridientList[i].unit == "Grams" ? "selected" : "" %>>Grams</option>
</select>
</div>
<%} %>
</div>
<%} %>
<br />
<br />
<label for="txtDescription">Recipe Description</label>
<textarea id="txtDescription" runat="server" cols="20" rows="2"></textarea>
<asp:Button ID="Button1" runat="server" Text="Save Changes" OnClick="Button1_Click" />
<a href="RecipeDetails.aspx?recipe=<%= Convert.ToString(Request.QueryString["recipe"]) %>">Back</a>
</asp:Content>