Hi raneamey,
Please try the example below
- <%@ Page Language="C#" %>
-
- <%@ Register TagPrefix="DotNetGallery" Namespace="DotNetGallery" Assembly="DotNetGallery" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <script runat="server">
-
- protected void btnCreate_Click(object sender, EventArgs e)
- {
- using (DotNetGallery.GalleryDataProvider provider = DotNetGallery.GalleryDataProvider.CreateInstance(Context, "~/GalleryFiles/"))
- {
- provider.CreateCategory(tbName.Text, tbDescription.Text, "");
-
- }
-
- }
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>Untitled Page</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <table>
- <tr>
- <td>
- Category Name:
- </td>
- <td>
- <asp:TextBox ID="tbName" runat="server"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td>
- Category descriptioin:
- </td>
- <td>
- <asp:TextBox runat="server" ID="tbDescription"></asp:TextBox>
- </td>
- </tr>
- </table>
- <asp:Button ID="btnCreate" runat="server" Text="Create Category" OnClick="btnCreate_Click" />
- <DotNetGallery:GalleryBrowser ID="galleryBrowser1" runat="server" AllowEdit="true" />
- </div>
- </form>
- </body>
- </html>
Regards,
ken