I cannot get this method to work. I get a system. XmlException. The code below jsut shows how I am starting out. I want to create a simiple document and save it before I start working out how to add nodes etc. The file path will be my local machine - this project will all be on my local machine at the moment not even on a web page/server at all yet. Just a simple app to learn the basics of XML before I add to a web application I'm working on.
I have customer data saved into my database. when the customer access this data through his login and if clicks save to csv, the data has to be saved into their local machine. I am using asp.net version 1.1 and VS2003.
Alright.. I'm making a quiz system where the amount of questions and answer options is unknown.. Is it best to save the answer the user chosed when clicking submit to next question or save them all at once when the last question is submited?Lets say we have 3 questions, which one of these two options is the best for saving the data?
Question1 -> Save -> Question2 -> Save -> Question3 -> Save -> Done Question -> Question2 -> Question3 -> Save -> Done
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 wrote a webmethod (Called SearchData()) in which the method makes a httpwebrequest to another url and gets the data in xmldocument. After getting the xmlDocument ,it is returned to SearchData method invoker. When i invoke the from browser it works fine. But When another application in java tries to consume this webmethod SearchData(), it is getting the error
<wsdl:part name="Body"/>
and each part should be type defined. The WSDL file is not well formatted. it doesn't have Type defined at each element. How to fix this.or Is there any other Better way to provide the end user the xml(ie from httpwebrequest result in webmethod ) with a soap wrapper ie with a well defined wsdl. My code :
When I click a button, it will bring out a ModalPopup panel saying "Pls wait" until the process is finished at the code -behind. The process is generating an excel file and prompt out a save as dialog box. However, When I called the code below, the modalpopup panel will not be closed automatically.
if I don't call the code above, the modalpopup panel is closed success.
I want the ModalPopup panel to be closed automatically after saving the file, is there any way to bring out a save as dialog box other than using Response. method?
I have to add an XmlDocument to my application state so that everytime my application doesnt access the XML file on my filesystem, I will add this at the Application_Start() function in Global.asax.cs
I am adding this to system state as :
protected void Application_Start(Object sender, EventArgs e) { string filePath = Server.MapPath("<path to my XML FILE>");
[code]...
In this code i try to load the xml file and if the file is not loaded due to any problem then i am wanting a null XmlDocument.I access this XmlDocument as :
XmlDocument xmlDoc = new XmlDocument(); xmlDoc = HttpContext.Current.Application["xmlDoc"];
the error i get while build is Cannot implicitly convert type 'object' to 'System.Xml.XmlDocument'. An explicit conversion exists
So How to assign the HttpContext.Current.Application["xmlDoc"] variable as System.Xml.XmlDocument ?
I have some problems. Im developing web apps with Youtube APIs( feeds). The problem is: - Client visit my site, my site use XmlDocument object to load xml feeds from youtube server with my server IP address for request feed.However, youtube API is limited number request feed per IP address at the same time. -I want to assign Client IP to request Youtube APIs feed instead of my server ip address to avoid limitation.
I'm getting back into coding after a seven year absence. Loving it, but everything is taking me so long!Anyway, I'm trying to upload a file from the browser and then read it into an XmlDocument object on the server. Originally I cracked this by saving the file to disk, reading it into the XmlDocument object and then deleting the file. The only problem was that the delete action was trying to take place before the XmlDocument.Load action had completed
I'm having a confusing issue concerning web services, XmlDocument return type and XmlProcessingInstruction. I've basically got a web service that returns an XmlDocument containing a list of search results. In order to make it a little more user-friendly, I'd like the XmlDocument to include a Processing Instruction (<?xml-stylesheet type='text/xsl' href='book.xsl'?>) for the inclusion of an XSL stylesheet. Is there something in the ASP.NET pipeline that would prevent this? I'm using the following code (lifted from the MSDN documentation of the CreateProcessingInstruction() method) in a test WebMethod and it doesn't seem to include the processing instruction.
I have a method in one class file with defination like this which gets the user id of logged person.
public string GetUserID(HttpRequest req) { .... }
I need to call this method in global.asax and save that value in session. I need to use this session value i need to use this Session value and assign that to label in Masterpage. I did not use global.asax before. And what should be the input to method... i have seen only Request is have the returntype HttpRequest. So i thought of giving that.
I am using a third party service for location time(zonal).If I pass latitude and longitude of the location with service URL it returns the time of that location in XML format.But the problem is some of the time this service gets too much slow so because of that my home page gets stuck because its a synchronous call of that service.here my code-
I've just discovered that the X-Requested-With header in IE is always "XMLHttpRequest, XMLHttpRequest" instead of just "XMLHttpRequest". I found the reason in MicrosoftMvcAjax.debug.js at line 280 (MVC 2.0). Seems there is no need to add this header again as it is already done in Microsoft AJAX Library. And because of this IsAjaxRequest extension method doesn't work anymore if there is no X-Requested-With param in the request body. And this make X-Requested-With header useless in IE.
In Firefox there is no problem as it doesn't append but replace the existing header value. Not tested in other browsers.
I am trying to get my cascading comboboxes to work, but am getting a [Method error 500]. Any ideas? I've searched online, the code should work....Thanks in advance for your help!
ADDSTORY.ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="addstory.aspx.cs" Inherits="addstory" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <form id="form1" runat="server"> <asp:ToolkitScriptManager ID="ScriptManager1" runat="server" /> <td class="style3"> <asp:DropDownList ID="selectproject" runat="server" Width="225"></asp:DropDownList> <asp:CascadingDropDown ID="ccd1" runat="server" ServicePath="~/dropdown.asmx?company=<%=co_id %>" ServiceMethod="GetProjects" TargetControlID="selectproject" Category="Project" PromptText="Select Project" /> </td> </tr> <tr> <td class="style3"></td> <td width = "150" class="style3">Iteration:</td> <d class="style3"> <asp:DropDownList ID="selectiteration" runat="server" Width="225"></asp:DropDownList> <asp:CascadingDropDown ID="ccd2" runat="server" ServicePath="~/dropdown.asmx?company=<%=co_id %>" ServiceMethod="GetIterations" TargetControlID="selectiteration" Category="Iteration" PromptText="Select Iteration" /> </td> </tr> DROPDOWN.ASMX: using System.Web.Script.Services; using AjaxControlToolkit; using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Collections.Generic; using System.Collections.Specialized; using System.Data.SqlClient; /// <summary> /// Summary description for WebService /// </summary> [WebService(Namespace = "[URL]/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService()] public class dropdown : System.Web.Services.WebService { private string GetConnectionString() { return System.Configuration.ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString; } [WebMethod] public CascadingDropDownNameValue[] GetProjects(string knownCategoryValues, string category) { string co_id = this.Context.Request.QueryString["company"].ToString(); SqlConnection conn = new SqlConnection(GetConnectionString()); sonn.Open(); SqlCommand comm = new SqlCommand("Select ProjectName, ProjectID FROM Project WHERE CompanyID = '" + co_id + "'", conn); SqlDataReader dr = comm.ExecuteReader(); List<CascadingDropDownNameValue> l = new List<CascadingDropDownNameValue>(); while (dr.Read()) { l.Add(new CascadingDropDownNameValue(dr["ProjectName"].ToString(), dr["ProjectID"].ToString())); } conn.Close(); return l.ToArray(); } [WebMethod] public CascadingDropDownNameValue[] GetIterations(string knownCategoryValues, string category) { int ProjectID; StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues); if (!kv.ContainsKey("Project") || !Int32.TryParse(kv["Project"], out ProjectID)) { throw new ArgumentException("Couldn't find project."); }; SqlConnection conn = new SqlConnection(GetConnectionString()); conn.Open(); SqlCommand comm = new SqlCommand("SELECT Select CONVERT(VARCHAR(10), StartDate, 103) + ' - ' + CONVERT(VARCHAR(10), EndDate, 103) AS Iteration, ProjectIterationID FROM Iterations WHERE ProjectID=@ProjectID", conn); comm.Parameters.AddWithValue("@ProjectID", ProjectID); SqlDataReader dr = comm.ExecuteReader(); List<CascadingDropDownNameValue> l = new List<CascadingDropDownNameValue>(); while (dr.Read()) { l.Add(new CascadingDropDownNameValue(dr["Iteration"].ToString(), dr["ProjectIterationID"].ToString())); } conn.Close(); return l.ToArray(); } }
I am trying to use YAF with Umbraco. The newest version out changed enough where the old integration methods don't seem to work. I have gotten everything fairly far on my own but I have hit a brick wall with this error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source Error: Line 23: <img src="~/yaf/images/YAFLogo.jpg" runat="server" alt="YetAnotherForum" id="imgBanner" /><br/> Line 24: <form id="form1" runat="server" enctype="multipart/form-data"> Line 25: <YAF:Forum runat="server" ID="yafForum" /> Line 26: </form> Line 27: </body>
I have a feeling that YAF is not starting up the database. In previous versions of YAF there was an INIT module that you loaded in your web.config file. This module is no longer there (YAF.Base.YAFInitModule).
i have a masterpage and other pages. i want to use findcontrol method to find a textbox (not on the master page) to check whether it is empty or not.
my code is as folows; Dim myContentPlaceHolder As ContentPlaceHolder = CType(Master.FindControl("MainContent"), ContentPlaceHolder) Dim UpdatePanel1 As UpdatePanel = CType(myContentPlaceHolder.FindControl("UP1"), UpdatePanel)
I have a page with an update contentpanel, with 4 panels inside. Image buttons outside the update panel control control which panel is visible. I am trying to call an animation from a javascript function, but the animation doesn't work, everything else does.
I have a web service that has a CreateReport method that generates a report based on the specified criteria.
When I call this method Synchronously using a Windows Application or Console Application, the call works fine and the report is created.
When I call this method ASynchronously (CreateReportASync) using Windows Application the report is created.
When I call this method ASynchronously (CreateReportASync) using Console Application the web service does not even get the call.
I am using VS2005 and .Net Framework 2.0. So the proxy is automatically created with the Async methods. I am not really interested the result of the method call, so I do not add a Callback Delegate.