コード例 #1
0
ファイル: StopSearch.aspx.cs プロジェクト: Ville1/StopCheck
        protected void SearchResultsRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            Data.Stop stop = e.Item.DataItem as Data.Stop;
            HyperLink link = e.Item.FindControl("StopHyperLink") as HyperLink;

            link.Text        = stop.Name;
            link.NavigateUrl = "~/Views/Stops/Stop?id=" + stop.Id;
        }
コード例 #2
0
ファイル: Stop.aspx.cs プロジェクト: Ville1/StopCheck
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            if (string.IsNullOrEmpty(Id))
            {
                Response.Redirect(UrlHelper.ERROR_PAGE);
                return;
            }

            Data.Stop stop = Api.GetStop(Id);
            if (stop == null)
            {
                Response.Redirect(UrlHelper.ERROR_PAGE);
                return;
            }
            NameLiteral.Text = stop.Name;
        }