I am trying to save an updated xml file to a url like this:
Quote:
//save the output to a file
xmlDoc.Save("http://www.example.com/HomeNewsLinks.xml");
But I get this error: URI formats are not supported.
Did some google search on this and it seems I need to use client.uploadFile method, but I am not able to find how to declare/define filenamexxx (below) and how to pass a username/password.
Quote:
WebClient Client = new WebClient();
Client.UploadFile("http://www.example.com/HomeNewsLinks.xml", Post, filenamexxx);
I am a new to WCF. I have written ajax to use a web service before, but on this project I am trying to use ajax to WCF.After I build the project and wcf using ajax, I receive the return successfully. But, 10 or more minutes later I don't get a return, the ajax calls the error function, and the fiddler returns nothing.
If I rebuild the project without any source modifying, I receive the return successfully again.
I am following though the examples in Professional ASP.Net MVC 2 and one of the examples doesn't work for me.
[HttpPost] public ActionResult Edit (int id, FormCollection collection) { Dinner dinner = dinnerRepository.GetDinner(id); if (TryUpdateModel(dinner)) { dinnerRepository.Save(); return RedirectToAction("Details", new { id = dinner.DinnerID }); } return View(new DinnerFormViewModel(dinner)); }
I understand that it's suppose to take the values from the FormCollection, and then update the dinner object with it, bit I don't see the collection get referenced anywhere.
I have div which it is hidden by default , when the use clicks show link the following javascript method is called:
function ChangeControlVisibility(elementID) { var element = $("#" + elementID); if (element.css('display') != 'block' && element.css('display') != 'table') { element.show();
[code]....
this step works but when i call the previous method at page_load event the method doesn't work: element.css('display') undefined.
I have a Gridview in UpdatePanel and a textbox in which i input a string, the row is searched from gridview onkeyup of textbox.For example when i entered "testing" one row is displayed in gridview having "Edit" command and when i clicked on "Edit" it goes to top of the row having another data is converted into edit mode but that rows is not changed into textbox.
Then I tried to retrieve node type from Node this way - Nodes node = Entities.Nodes.First(); string nodetype = node.NodeTypes.Name; but for some reason node.NodeTypes equalls null despite fact that there is some records in NodeTypes table.
I have a listview in which I use a pager control. When I have more than 1 item in the list view, I want the user to be able to click on the appropriate page number and go to it. Simple right?, right now the first time the user clicks on the page number, nothing changes. If they click on it again, it goes right to the page. It doesn't matter what page they click on, it ALWAYS requires a second click to display the data item.
I know that UpdateProgress doesn't work with PostBackTrigger, but let me explain what i'm trying:
I'm generating a PDF document (Crystal Report) with ExportToHttpResponse that will be downloaded automaticaly by the browser.
So while the document is been generated, i'd like to show the UpdateProgress just while i'm waiting the doc is being generated, doing the UpdateProgress(or some label) to disappear.
I've been trying to fix something on a secure website (https) which is an Export to Excel button that generates a CSV file. It works on Firefox, Chrome , etc... but not in Internet Explorer. I have changed the headers eliminating the no-cache and also edited the IIS http header configuration setting an expiration date of 1 day. I have no idea of what can be going on and how to solve it. Do you guys have any idea of how to fix this stuff ? I've read so many posts and they're all saying the same thing... caching.
UPDATE 1 :
regarding the error I receive, I receive an IE Alert saying "Internet explorer cannot download filename.aspx from [URL]Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. As I said, it all works out of SSL (https), but the export to excel button, breaks in https.
Iam trying to use a UserControl named CheckBoxControl as value for the ExpandControlID/CollapseControlID attributes of the CollapsiblePanelExtender. It works fine when I use a normal CheckBox instead.
When I run the site, most ajax controls on my site disappear and I get following errors in firefox script error console:
Fehler: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method. Fehler: Sys.ArgumentException: Failed to find element "ucHaftpflicht.CheckBox" Parameter name: CollapseControlID
The forms works fine in Firefox and I was able to get an email from it. Here is the code below:
Partial Class _Default Inherits System.Web.UI.Page ''' <summary> ''' Actions when the Send button is clicked. ''' </summary> ''' Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click If Not Page.IsValid Then Exit Sub 'Create instance of main mail message class. Dim mailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage() 'Configure mail mesage 'Set the From address with user input mailMessage.From = New System.Net.Mail.MailAddress(txtEmailAddress.Text.Trim()).........
i have set of link buttons outside update panel but when click any one of them they donot work at all , when i set the postbackUrl they make full postback my source code :
I´m using in my application the control :ModalPopUpExtenter. In my computer testing localhost, it works fine. But when i put my application on my server, everything works fine except the ModalPopUp.In the page that i use it, my panel is appearing for my user, but i don´t receive any error message.I pute the dlls: AjaxControlToolkit.dll, System.Web.Extensions.dll and System.Web.Extensions.Design in the folder bin.
I have the following class that I have all my controllers inherit from:
[Code]....
I would like to aways redirect to the login page where // this isn't workingThe current code runs, but it still allows access to the views that I want to block when the user isn't logged in
I'm currently developping an application using MVC2 and Globalization (fr and de). I'm creating a form who use DataAnnotation on the model for validation, with localized error messages in my dataAnnotations.
Here is the trick :
I have two <input /> :
One for a required date (example : 12/05/2001) wich is a DateTime field in the model :
[Code]....
One for an optionnal hour (example : 22:30) wich is a DateTime? :
[Code]....
Erreur and LibellesSinistre are my ressources files.
I got two problems :
I can enter a date in my hour field and an hour in my date field.My error messages aren't localized. Do I need a trick or something to make it work ?
I'm using routing from System.Web.Routing without MVC in a standard ASP.Net Web Application Project application. This is mostly done to get neater urls in the portal we are developing (instead of ~/default.aspx?contentid=123 we have ~/{contentsubject}. The portal is not authorized and all info is in the url so in a caching scenario we can cache complete pages.
When I tried to enable output caching I noticed that no caching was done. It seems that the outputcache page directive is completely ignored. Is this true or am I missing something? Can this be fixed?
I made a small test app (I uploaded it to [URL] that just contains a page, Webform1.aspx, that uses a master page and a user control. All three output the current date and time.
When I request http//localhost/OutputcacheTest/Webform1.aspx the 10 second caching works as expected, i.e. the shown time only updates every 10 seconds.
The app also defines a wildcard route that catches all requests and returns the same Webform1.aspx as a handler. So when requesting http//localhost/OutputcacheTest/myroute the same page is executed but now the caching doesn't work, i.e. the current time is shown on every request.
Note: When using the built-in development web server both scenarios work, only IIS seems to have this problem.
Does anyone have a a solution or work around for how to enable output caching in this scenario?