I have an ASP.NET app that gets its data form an external service, via HttpWebRequest. Currently the request is made on the Page_Load event. After that event finishes I have my objects in the page and I output their data in the HTML. Sometimes the site hangs and throws timeout exceptions. Should I move the web request to an event prior to Page_Load ?
I have an asmx web service, and every time I try to call a static method in another project (which is a class library), I get an internal server error 500.
I have an extranet site (asp.net), we want that if an employee click on the link, it will automatically get them in. But if an external user does it, they will be redirected to a login page.
is it possible? how to know if a request come from internal user (employee) or external user (vendor).
I have an ASP.NET application running on multiple IIS6 web servers, with a SQL Server 2005 database back-end.
I need to:
monitor the database for the completion of an external job event, and then have exactly one web application instance submit some information to a web service For (1) it seems like a SqlDependency would be the best approach (or just plain old polling). Each web application instance would register such a dependency when it starts up. (I don't want to configure a 'master' instance because the failure of that instance would mean the task doesn't proceed, even if other instances are available. Thus my design is to ensure that if there is an instance available to do the work, then the work ought to proceed.)
For (2) I have been thinking of having some sort of flag in the database that the web application instances try to update once they receive the SqlDependency notification in (1), along the following line (greatly simplified):
UPDATE StatusTable SET TaskStatus = 1 WHERE TaskStatus = 0
SELECT @@ROWCOUNT
that only one application instance would have been able to update the TaskStatus, and thus only one instance would have a @@ROWCOUNT > 0. This would then be the instance 'elected' to submit the information to the web service.
This is so frustrating to me. I'm doing this via standard .NET 2.0+ web services (not WCF). My application is in .NET 3.5 but I'm just adding a service reference. I've not done any SOAP WSDL sending before. I've used NVP which to me seems much more error prone and burdensome because you have to create all the wrappers yourself and if any of that third party API changes, it breaks your code. I have not a clue how to make a call using the latest PayPal WSDL. I added the service reference and I see proxy classes such as [className]Request and [className]Response but how do you actually make the CALL and send the request over the wire?
I see people have used the outdated (.NET 1.1) PayPal SDK. We do not want to use an SDK just to send a request. Isn't it much easier nowdays in .NET when using any SOAP API to invoke the request? People for example using PayPal are relying on a caller class from that SDK but again it's way, way outdated. So onto today, .NET 2.0+, I thought that you don't need all that plumbing anymore?
How would I do this? I see no good documentation on the net period on .NET 2.0 or 3.5 web services especially SOAP and it's frustrating. Sure add the service reference, use the WSDL and proxy generated class wrappers but outside this HOW to make a request is impossible to find. I'm seeing legacy ways of doing this in .NET and then I hear this is all done under the covers for you in .NET..I guess that must be .NET 2.0+ ?? Is it as simple as just making the proxy class method calls and .NET under the covers takes care of the plumbing to actually send the request over Http unlike .NET 1.1 where you had to do all the plumbing yourself?
I want to make my queries better but have been un-able to find a resource out there which lays out when a query is shipped of to the db.
DBContext db = new DBContext(); Order _order = (from o in db where o.OrderID == "qwerty-asdf-xcvb" select o).FirstOrDefault(); String _custName = _order.Customer.Name +" "+_order.Customer.Surname;
Does the assignment of _custName need to make any request to the database?
I have a page that contains a user control. Can i make an ajax request directly to the control? I know I can make an ajax request to .aspx or .ashx; however, is it possible to go direct to the .ascx?
I have several ASP.NET sites, hosted on the same domain (different subdomains) and working via HTTPS.I have WCF service, hosted on the same domain.I have a separate state server for sessions. why - i will reply later, but it's a 'must') On my sites, I use grid components from Telerik (but actually it does not matter) that ask for data from WCF service and must be filled with this data.I cannot manage to make POST request to WCF service from javascript: for some reason it's always either GET or OPTIONS (no matter if I use Sys.Net.WebServiceProxy invoke or just a plain jquery AJAX request). It happens even if I indicate COOKIE mode
I have integrated Third party advertise module in my website. their domain s "http://rotator.adjuggler.com/".they read cookie from this domain and display advertise based on cookies value. now I want to set cookies on this domain from my website.though this is not possible. they have provided url to set cookies.http://rotator.adjuggler.com/servlet/cookie?action=set&name=test&value=1&maxage=2592000we can set cookies on their doemain by calling above ur.Problem:1) we can't make xmlHttp request because this is cross-doamin link.2) we can't use jquery because it uses xmlHttp as native implementation.3) i have tried to set above url in <img src="..." > and <script src="...">. both not working.but when i paste above url in address bar it works.can anybody have idea how to call above url from Code.
I want to provide status updates during a long-running task on an ASP.NET WebForms page with AJAX.Is there a way to get the ScriptManager to execute and process a script for a web service request concurrently with an async postback? I have a script on the page that makes a web service request. It runs on page load and periodically using setInterval(). It's running correctly before the async postback is initiated, but it stops running during the async postback, and doesn't run again until after the async postback completes.
i'm just getting started with asp.net and ajax. My question is : is it possible to make an ajax request and simulate the server response in the code behind. in other words can the request be sent to the code behind of the same page? if it's possible haw can i perform this ?
I have an ASP.NET project (VS2008 on Windows 7 with either webforms, MVC1, or MVC2 -- all the same result for me) which is just the File->New hello world web project. It's using the default ASP.NET development server, and when I start the server with F5, the browser never connects and I get a timeout. I tried to debug this by telnetting to the development server's port while it was running, and I got the same result:
C:Usersfarmercs>telnet localhost 54752 Connecting To localhost...Could not open connection to the host, on port 54752: Connect failed I can see in the system tray that the server thinks it's running, and a netstat -a -n command shows that there is indeed an active TCP listener on that port.
This worked in the not-too-distant past, and I could work on web projects using the development server. One thing that has changed since then was that I installed the Microsoft Loopback Adapter to accommodate a local development Oracle installation. I'm not sure this is the problem, but it seems a likely culprit.
I also tried to hit the port using the server name itself (http://mycomputername:54752) but with the same result. So, what could be blocking me from connecting? And if it's the loopback, then what is a good way for me to retain my ability to connect to my development Oracle server while still being able to use the ASP.NET development server?
For example, I have three UpdatePanels on the page. I click a button, and I get pretty long response, that contains all the data for the three UpdatePanels, the viewstate string.
I want to optimize my query and receive response like "ok" or "not ok". How can I do that?
Because of a restriction on our analytics software, we need to pass all calls to external weblinks through a page - direct clicks to external links don't get recorded.Our classic asp page was simple. We had a link to out.asp?urlname and the out.asp did a redirect. I'm trying to emulate this in MVC without success.On the homecontroller, I've got an action:
Function externalLink(Byval id as string) as ActionResult Return RedirectToRoute(id) End Function
I thought I was close with the following actionLink:
<%=Html.ActionLink("more info at HMRC", "externalLink", "Home", New With {.id = "www.hmrc.org.uk"}, DBNull.Value)%>
But the URL that is formed is /Home/externalLink/www.hmrc.org.uk .I've had a route in mapRoute, but taken it out as it didn't affect things. I've tried replacing .id with a paramater name like .url so the url becomes Home/externalLink?url=www.hmrc.org.uk but the problem is really that it can't find the resource
Requested URL: /Home/externalLink
It does seem like a simple thing, but I guess I need to step away for a few hours and look at it again with fresh eyes - Sunday working wearing me out!
I've a page which consolidates different sections by different .aspx pages. Those pages will be loaded into corresponding div(s) dynamically by using jQuery.load(). They all are rendered properly, however, when clicking on any asp:button in any section page, the entire main page will be replaced by the section page even the asp:button is just popping up a message box.
I am using a thrid party website for a service. I transfer control and data to an external URL provided by the service provided. Once the service provider processes the data, it transfers the results and control back to a page in my website. I would like to allow only the service provided URL/page to redirect to my website. Is there any way to do this?
I am using hidden variables on a form and a button control with the PostBackUrl attribute set to the service provier URL, to submit the data and control to the external webpage.Will Service Variables help me achieve the above objective?
How do I create a new event in a base page class that fires after all derived pages have fired their load events but before any controls fire their load events.
The following code fires the event before the derived page's load event. I want it to fire the event after the derived page's load event but before all control load events:
Base Class:
Public Event FirstLoad(ByVal sender As Object, ByVal e As System.EventArgs) Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then RaiseEvent FirstLoad(sender, e) End If End Sub
Derived Class:
Private Sub Page_FirstLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.FirstLoad 'Stuff here happens before controls load but only on first page loads' End Sub
I have a master page in my website. I want some sort of container to load external website in my contentplaceholder.Frames and object tags are the tried options. My DOC type doesn't support Frames and object tag has that scroll border displayed by default and I can't remove it because it will be a page from another domain.
On the loaded site the users will be able to browse and search products, so I just dont want to read the html once. That will be the actual website loaded/displayed.