protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ActivityType activityType = new ActivityType(); ActivityTypeHandler activityTypeHandler = new ActivityTypeHandler(); string activityTypeID = Request.QueryString["activityTypeID"] as string; activityType.ActivityTypeID = Convert.ToInt32(activityTypeID); activityType = activityTypeHandler.GetDetails(activityType.ActivityTypeID); txtTitle.Text = activityType.Title; } }
protected void Page_Load(object sender, EventArgs e) { string activityTypeID = Request.QueryString["activityTypeID"] as string; if (activityTypeID == null) { Response.Redirect("Z_ActivityTypeDefault.aspx"); } try { activityTypeActivityTypeID = Convert.ToInt32(activityTypeID.Trim()); activityTypeHandler = new ActivityTypeHandler(); ActivityType activityType = activityTypeHandler.GetDetails(activityTypeActivityTypeID); lblActivityTypeID.Text = activityType.ActivityTypeID.ToString(); lblTitle.Text = activityType.Title.ToString(); } catch (Exception) { Response.Redirect("Z_ActivityTypeDefault.aspx"); } }