-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdmin.aspx.cs
38 lines (34 loc) · 1.09 KB
/
Admin.aspx.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Admin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLogin_Click(object sender, EventArgs e)
{
if ((txtUser.Text == "admin") && (txtPass.Text == "admin"))
{
lblUspjeh.Visible = true;
panelAd.Visible = true;
}
else
Response.Redirect("Default.aspx");
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[index];
int id = Convert.ToInt32(row.Cells[0].Text);
Response.ContentType = "Application/pdf";
//Get the physical path to the file.
string FilePath = MapPath("~/docs/Web_narudzba#" + id + ".pdf");
//Write the file directly to the HTTP content output stream.
Response.WriteFile(FilePath);
Response.End();
}
}