protected override void OnPreRender(EventArgs e)
        {
            var parameters = new NameValueCollection();
            parameters.Add("itemId", Request.QueryString["id"]);
            parameters.Add("frame", gridEditorFrame.ClientID);
            parameters.Add("hiddenId", hiddenValue.ClientID);
            parameters.Add("fieldName", FieldName);
            parameters.Add("layoutClass", LayoutClass);

            if (ValidateLayout())
                gridEditorFrame.Attributes.Add("src", "/handlers/GridEditorHandler.aspx?" + parameters.ToUrlParameterList());
            else
                gridEditorFrame.Attributes.Add("src", "/handlers/FixGridLayoutHandler.aspx?" + parameters.ToUrlParameterList());

            base.OnPreRender(e);
        }
Пример #2
0
        public static string ReplaceUrlParameters(Dictionary<QueryStringKey, string> replacements)
        {
            var result = CmsService.Instance.CurrentUrl != null ? CmsService.Instance.CurrentUrl.LocalPath : string.Empty;

            var collection = new NameValueCollection(HttpContext.Current.Request.QueryString);
            foreach (var key in replacements.Keys)
                collection[key.ToString()] = replacements[key];
            if (collection.Count > 0)
                result += "?" + collection.ToUrlParameterList();

            return result;
        }
Пример #3
0
        public static string ReplaceUrlParameter(QueryStringKey key, string value)
        {
            var result = CmsService.Instance.CurrentUrl != null ? CmsService.Instance.CurrentUrl.LocalPath : string.Empty;

            var collection = new NameValueCollection(HttpContext.Current.Request.QueryString);
            if (value == null)
                collection.Remove(key.ToString());
            else
                collection[key.ToString()] = value;
            if (collection.Count > 0)
                result += "?" + collection.ToUrlParameterList();

            return result;
        }
 protected void OnSearchClicked(object sender, EventArgs e)
 {
     var url = HttpContext.Current.Request.Url.LocalPath + "?";
     var parameters = new NameValueCollection();
     if (!string.IsNullOrEmpty(txtQuery.Text))
         parameters.Add("query", txtQuery.Text);
     if (!string.IsNullOrEmpty(txtFrom.Text))
         parameters.Add("from", txtFrom.Text);
     if (!string.IsNullOrEmpty(txtTo.Text))
         parameters.Add("to", txtTo.Text);
     if (ddlSubjects.SelectedIndex > 0)
         parameters.Add("subject", ddlSubjects.SelectedItem.Text);
     url += parameters.ToUrlParameterList();
     Response.Redirect(url);
 }
 public static string Post(string url, NameValueCollection values)
 {
     return Post(url, values.ToUrlParameterList());
 }
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            _hiddenField = new HiddenField();
            _hiddenField.ID = "hiddenValue";
            Controls.Add(_hiddenField);

            _iframe = new HtmlGenericControl("iframe");
            _iframe.ID = "iframe";
            _iframe.Attributes.Add("frameBorder", "0");
            _iframe.Attributes.Add("style", "width:100%");
            _iframe.Attributes.Add("height", Height.ToString());
            _iframe.Attributes.Add("scrolling", "no");
            Controls.Add(_iframe);

            var parameters = new NameValueCollection();

            AddParameters(parameters);

            _iframe.Attributes.Add("src", HandlerUrl + "?" + parameters.ToUrlParameterList());
        }