Alrighty, I've asked this question of Umbraco forums and Umbraco support, let's see who wins the race if I ask stackoverflow too. =)
ASP.net provides several options for posting data to another page or usercontrol within your site, but they all seem to fail within Umbraco (at least that's how it seems when reading through Umbraco forum posts or trying them myself).
I've tried using PostBackURL, but it's not-recommended in a couple of
forum posts, and it seems to break the onclick of the other buttons on the page.
I've tried using Server.Transfer, but it doesn't seem to work in a
handler like Button onclick.
I can't use Response.Redirect and put data in the GET query string,
because there's a big chunk of data to transfer ... I need to POST.
Is there a recommended way of doing this for an Umbraco site?
So If I understand your question correctly, you are trying to import / use an ASP .Net user control with umbraco? And the question is around you having issues trying to achieve this?
If so please comment on this answer and I will update with a solution.
Related
i'm not sure how to call that. i'm looking for some samples guiding me how to implement a automatic page extend. i'm mean something like the friends list on facebook. first only a few friends are loaded. after you scroll down, some others get loaded.
thx in advance
The solution to your problem relies more on AJAX then anything else.
I suggest using jQuery Ajax, and here is a nice article that will get you started with calling ASP.NET web services via client side script.
enter link description here
If you don't have experience using ajax this will probably be a lot for you to grasp. Especially if you're going to dive in with a feature like you described above.
Edit: It may be more practical to use a plugin to achieve this:
scrolling jQuery plugin
I'm working with ASP.NET 3.5 C#
I've seen a good few questions like this around but havn't actually come across any articles with the answer (maybe just been unlucky with my research!).
Basically I'm looking to have say 3 links (or buttons) on a page, which in turn will dynamically load a specific user control into an update panel with AJAX.
Then I would like the usercontrol loaded to be capable of handling postback within the update panel (basically no page refreshes) to do its processing and return output.
Is this possible?
Does anyone have any pointers to articles/blogs covering this?
I've seen many, but none covered handling postbacks from the user control or handling the postbacks within the update panel.
I may even have the wrong end of the stick here.
Any tips would be great to start me off :)
Cheers!
Have a look at this blog post.
It may not be exactly what you want (Postback issue), but can be a good alternative solution to get started with.
I just wanted to ask a question about uploading files via AJAX. I have researched on the web and found many articles on doing this. I am using ASP.NET 2.0.
I am probably going to go the jQuery route on this one, but I'm still unsure, I just need some feedback. Bacause my aim is to create an admin page for my client to add new products to his site when my client wishes to, so my client wants a simple file uploader and a multiple file uploader.
The first question is which is the best AJAX File Uploader to use?
The second question is how many files can you upload via AjAX, are there limits to how much you upload with different techniques ie. using jQuery or SWFUpload or using IHTTPHandler?
I would be grateful for your feedback.
Thanks.
I actually had to do this for an item here at work. To keep things rather simple, I went old-school and used a hidden iframe to do the file transfer in the background. There may be more fancy ways, but this worked for me. Also, there's no headaches when Adobe pushes out a bad update.
It was a while ago, so I can't remember the nuts n' bolts of the top of my head, but here's an article that seems to be using the same idea:
http://www.openjs.com/articles/ajax/ajax_file_upload/
This is a subjective question, as there is no one solution fits all for your application. The right answer is the uploader that meets your business needs. Limitations, if they exist, are set per whatever component you decide to use.
I have a pretty slick website and I wanted to add a simple blog system to it, without too much work. I've looked into a few blog systems, but none of them seem to be simple almost control like systems.
So anyone have any recommendations for a simple asp.net blog engine?
There's usually not much to a blog. A table to hold the entries, a page to make entries, and a page that lists them out.
If you want people to leave comments, then again it's not that hard. A table to hold the comments and a section on your blog viewing page to add a comment. I would use some form of a captcha entry, their name, and the actual comment itself; no need to "register" to be a user.
All in all, probably a good couple hours work; which would be less than implementing someone elses stuff. Just be sure to sanitize the comments to prevent xss attacks.
The ASP.Net site contains a section for community open source projects and starter kits. One of the open source sections is blogs:
http://www.asp.net/community/projects
Subtext is simple to setup, but if you want to integrate blogging into your site you can try BlogEngine. You can find links to both of them in the link above.
I have a ASP.NET 3.5 webforms project I have enabled routing over.
I also have in the project a number of controls doing different things based on what page they are currently being shown in. It would seem that the most straightforward way to control this different behavior is to discover which route was used to load the page and then do things according to that.
However, I can't seem to find a way to discover the route bar looking at the actual request URL and running a regex over it which isn't great. Does anyone know a way to look it up some other way?
Update: there still doesn't appear to be a way to do this in ASP.NET 4.0. Hopefully someone else has figured this out?
It looks like Phil Haack has answered this question in a blog post on his site: http://haacked.com/archive/2010/11/28/getting-the-route-name-for-a-route.aspx
In a .NET 4 webforms app, I used this to determine the route definition.
string myOperation =
((System.Web.Routing.Route)(Page.RouteData.Route)).Url;
//string has value "Stop" or "Start"
Let's say your routes are like so:
routes.MapPageRoute("StopEmailAlerts",
"Stop/{SomeToken}",
"~/Emailing.aspx", false);
routes.MapPageRoute("SendEmailAlerts",
"Start/{SomeToken}",
"~/Emailing.aspx", false);
I posted a couple of simple extension methods you can use to get/set the route name on this post. Seems simpler (to me) than Haack's solution.