This is a migrated thread and some comments may be shown as answers.

Post method

3 Answers 60 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 31 Mar 2011, 05:55 PM
Hello!!!!!

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
Tom

=====================
        try
            {
                WebClient svc = new WebClient();
                svc.Headers["Content-Type"] = "application/xml";
                string clickThroughXml = this.BuildClickThroughXml();
                svc.UploadStringCompleted += new UploadStringCompletedEventHandler(svcUploadCompleted);
                svc.UploadStringAsync(new Uri("http://preproduction.newcropaccounts.com/InterfaceV7/RxEntry.aspx"), "Post", clickThroughXml);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }          

3 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 06 Apr 2011, 09:54 AM
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.

Regards,
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
0
Mostafa
Top achievements
Rank 1
answered on 16 Jul 2011, 11:47 AM
Hello
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;
                tmpWindow.ShowDialog();
            };
            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?
Regard
0
Kiril Stanoev
Telerik team
answered on 21 Jul 2011, 09:28 AM
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.

Regards,
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!

Tags
HTMLPlaceHolder
Asked by
Thomas
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Mostafa
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Share this question
or