Post method

4 posts, 0 answers
  1. Thomas
    Thomas avatar
    9 posts
    Member since:
    Mar 2007

    Posted 31 Mar 2011 Link to this post


    I want to post XML to other URL and get the url back in the RadPlaceHolder. I am unable to get the URL back in the Radplaceholder.
    Please advice. I am trying with following code.

    Thank you

                    WebClient svc = new WebClient();
                    svc.Headers["Content-Type"] = "application/xml";
                    string clickThroughXml = this.BuildClickThroughXml();
                    svc.UploadStringCompleted += new UploadStringCompletedEventHandler(svcUploadCompleted);
                    svc.UploadStringAsync(new Uri(""), "Post", clickThroughXml);
                catch (Exception ex)
  2. Miro Miroslavov
    Miro Miroslavov avatar
    588 posts

    Posted 06 Apr 2011 Link to this post

    Hi Thomas,

     So what you're doing in the svcUploadCompleted handler method? Do you receive the post URL correctly? How you're trying to set it to the HtmlPlaceHolder?
    Thank you for your cooperation.

    Miro Miroslavov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Mostafa
    Mostafa avatar
    1 posts
    Member since:
    Aug 2010

    Posted 16 Jul 2011 Link to this post

    I have similar problem as Thomas, but i want to pass many parameters with POST that cant be sent with query string.
    The response is an HTML page that shows a report to user and i have orginal ReportViewer control on the server page that fetch the report with parameters.
    The client-side code is something like this:
    WebClient svc = new WebClient();
                svc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
                svc.UploadStringCompleted += (s, arg) =>
                    Frm_ReportViewer tmpReport = new Frm_ReportViewer();
                    //Set the HtmlSource property with the reponse message. Am i right?
                    tmpReport.PlaceHolder.HtmlSource = arg.Result;
                    RadWindow tmpWindow = new RadWindow();
                    tmpWindow.Content = tmpReport;
                    tmpWindow.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterScreen;
                    tmpWindow.Width = 700;
                    tmpWindow.Height = 500;
                StringBuilder tmpParameters = new StringBuilder();
                for (int i = 0; i < 1000; i++)
                    tmpParameters.Append(string.Format("key{0}=value{0}&", i));
                tmpParameters.Remove(tmpParameters.Length - 1, 1);
                svc.UploadStringAsync(new Uri(ADDRESS), "POST", tmpParameters.ToString());
    The arg.Result is already contains correct HTML but the window don't show the page correctly.
    What can i do?
  4. Kiril Stanoev
    Kiril Stanoev avatar
    1512 posts

    Posted 21 Jul 2011 Link to this post

    Hi Mostafa,

    Judging from your code, everything looks perfectly OK and I cannot determine what exactly is causing the issue. In its core, RadHtmlPlaceholder is simply an IFrame that is rendered on top of the Silverlight plugin. Therefore, we rely heavily on the internal IFrame to render any HTML content that is passed to RadHtmlPlaceholder. Is there any possibility you send us a sample project reproducing the issue? This way we will be better able to assist you.

    Kiril Stanoev
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top