Web Forms :: Find URL Of Domain Server From Coming Request
Sep 3, 2013
I want to find URL from the incoming request is coming. I am giving the explanation below
Suppose a client is redriecting the request from www.xyz.com to www.abc.com/ClientInfo.aspx. Now www.abc.com is in the asp.net c#. Now i want to find www.xyz.com on www.abc.com/ClientInfo.aspx page.
I've got a Silverlight app that has to accept some initial data when it fires up. That data, unfortunately, MUST come from XML input. In addition, I can't just pass it through the URL because the actual request is coming from a server external to my own.
So the basic setup is this: Remote server needs to launch my app. Remote server pops open a window on the user's PC with a URL directed at a CGI application that can accept the XML input. The CGI app parses the input and spits out an HTML page containing the Silverlight app with all of the init params set. Long story short: When the Silverlight app is opened this way I can't debug it. I attach to the process, but none of the break points can be hit.
I tried every way in the world to get the ASP.NET page that would normally host the Silverlight app to accept the XML in the URL but it would get stripped by ASP.NET because of security reasons and no amount of modifying the config file would fix it (since it was stemming from the other web server presumably).
I'm working with asp.net c# web application. We have completed site and hosted in dedicated server (own server).
This server having only one site (sharepoint site). A page having 1000+ images. Loading in base page. And slide show in popup page.
Base page image painting is going on. At same time popup page image is not loading up to base page paint complete. I changed popup image download to some other server means working fine.
Here my problem is same domain more than 2 request web server (iis) not responding up to first 2 requests complete. We can call 2 requests at a time. How to increase more than 2 request in ie. This problem is not available in Firefox. Firefox can manage more than 2 requests. Ie not allows only 2 requests to one domain at a time.
How to send more than 2 requests from ie to a domain?
In an asynchronous process, I need to get the name of the domain/server the web application is running on. But in that situation HttpContext.Current is not available, so I cant use HttpContext.Current.Request.ServerVariables("SERVER_NAME").
My web site is integrated into a client web site. Client web site reaches out to my site through an Xml request and I return Html embedded in an Xml response. Client site then displays the Html in an area on a page on their site. All is well so far...
Now, there is a link on the Html that does an HttpPost back to my site which causes a re-direct to another page on my site. i.e. [URL] -> HttpPost -> [URL]-> Response.Redirect("CookieTest.aspx"). Still, all is well. [URL]
All of the above can occur without authentication to mysite. Where I start running into problems is when CookieTest wants to do a FormsAuthentication.SetAuthCookie(). If I put a button on CookieTest that does FormsAuthentication.SetAuthCookie() and then Response.Redirect("SecurePage.aspx"), still under [URL], the SecurePage does not recognize the authentication because the auth cookie is not present.
1. Navigate straight to CookieTest.aspx
So I simplfied the problem into basic cookie set/read excercise and used the code below to test out cookie writing/reading ability. When I call the page directly from the browser I see that on initial load the response cookies are empty. Then on button click I see that the cookie is properly set in the response. Then on subsequent page refresh I see that the page load shows the request cookie.
2. Navigate to CookieTest.aspx in an HttpPost from [URL], as mentioned above.
Now on button click I see the cookie in the Response but do not see it come back in the Request of subsequent page refreshes, as if the client browser is rejecting cookies set by my server.
3. Navigate straight to CookieTest.aspx, then do the HttpPost from [URL]
In this case, since the cookie was set during a straight navigation to CookieTest.aspx, the cookie is present in the subsequent HttpPost/Redirect from [URL]. CookieTest.aspx has full access to the cookie and can even delete it.
4. Have CookieTest.aspx pop a new browser window simply sets the cookie and closes itself down.
Similar to #3, if the cookie is set through a popup window and then CookieTest is refreshed the cookie is present in the Request.
Notes:
The code does prove that the client browser accepts cookies.
When my page (CookieTest.aspx) is shown within the frame on the [URl] page, during any link back to my server, the Request.Url.Host shows my domain.
We are using IIS6 and .Net Framework 2.0 for our intranet with Windows and Digest Authentication . We have 2 domains that have access to this intranet. I suddenly have the need to display slightly different content for users from Domain A. The changes are rather trivial (text on a label and and image in a header) but important to our stakeholders.
for SEO purposes, instead of refreshing the page every click of a product, is it possible to click on the product and when the server comes back with the response, to change the URL of the page to reflect the new link to information currently on page?
point is to have ajax redraw the product details portion of the page but have SEO friendly url's displayed so if people want to bookmark the currently selected product, it will bookmark the right url instead of the generic one to access the products page..
For example... here's my entry point:
Products.aspx
product1product2product3 If I were to click product1, the request goes to the server with roducts.aspx?id=product1 but the url is still products.aspx on the response meaning that when people bookmark the product1 item, and they send the link to a friend, the friend always gets the generic product.aspx page.
I'm trying to get around this without refreshing the full page (postback).
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 developed a website in ASP.NET with huge Database, Now i have another website in HTML & PHP. I want to make user login authentication from HTML website which will authenticate the login details from the old website's Database.
Database used is SQL Server 2005.
I Created t HttpHandler to authenticate the user in old website.
I want to make a JQuery request from HTML website to old website which will authenticate login details and will redirect to the user to new page according to user type.
I'm going to be in a situation where I'll have www.DomainA.com and www.DomainB.com, each having seperate IPs. All requests to www.DomainB.com/{Path}, I'd like to redirect to www.DomainA.com/{Path}.
My initial reaction was, in the base directory, to simply create a HTTPModule and Web.config to add in the module, where the module would then redirect the request to DomainA.
The only problem with this is IIS is not executing the module, and instead determining itself whether or not there is a matching file or application to run based upon the requested path (i.e. so you'll either get an error about the requested file not existing, or a security error about not finding the requested application).
What do I need to change in IIS to always run my module? Or is there any easier way to do this using .Net 2.0 & IIS6?
I've got an ASP .Net application running on IIS7. I'm using the current url that the site is running under to set some static properties on a class in my application. To do this, I'm getting the domain name using this (insde the class's static constructor):
var host = HttpContext.Current.Request.Url.Host;
And it works fine on my dev machine (windows XP / Cassini). However, when I deploy to IIS7, I get an exception: "Request is not available in this context".
I'm guessing this is because I'm using this code in the static constructor of an object, which is getting executed in IIS before any requests come in; and Cassini doesn't trigger the static constructor until a request happens. Now, I didn't originally like the idea of pulling the domain name from the Request for this very reason, but it was the only place I found it =)
So, does anyone know of another place that I can get the host domain name? I'm assuming that ASP .Net has got to be aware of it at some level independent of HttpRequests, I just don't know how to access it.
I had a .net 4.0 vb.net page that was setting session variable and setting a hidden form value to the same value. It was a paypal buy now button. When the user selects it, they are sent to paypal for payment. If the transaction is good, they are redirected back to another page on my site and a hidden value is sent back with the invoice I originally sent them. They are sending the form value, but my session variable does not available.
From the user point of view it's all seamless.. Is it the same session? And should my session variable be available?
I'm building a greasemonkey script to make posting to craigslist a lot easier for our clients.
Basically the flow is this:
User logs into our system (established authentication cookies with asp.net)User navigates to a section on our site called "CraigsList". If they have the greasemonkey script installed it automatically opens up craigslist in a new tab.
The greasemonkey script then does a request back to our site at [URL] to retrieve a list of available items to be posted to craigslist.
This is where it fails because the request to [URL] is not including any of the authentication cookies. I'm not sure if it doesn't include the cookies because the request originates from [URL] and not [URL] or what. I know it's an authentication issue because looking at it in fiddler it returns a 302 and redirects to the login page.
I'm still new to windows authentication. Basically, we have a page on http://externalsite.com that needs to be accessed only by an authenticated user originating from http://internalsite. The user on internalsite is already authenticated using windows authentication.I'm confused here. How can I validate the user and obtain their role so that i can not only validate that they are authentic, but to authorize them to use this page on externalsite.com?
I have a simple script making a request to the server:
var DTO = { 'path': path }; var url = 'default.aspx/Get'; var test; $('#getInstance').click(function () { $.ajax({ url: url, type: 'POST', dataType: 'json', data: JSON.stringify(DTO), contentType: 'application/json; charset=utf-8', success: function (msg) { test = msg; }, error: function (jqXHR, textStatus, errorThrown) { alert(textStatus); alert(errorThrown); } }); });
This works fine as in it connects to the server and gets the data back, with one simple problem. It is treating this request as a cross domain request, therefore using jsonp. The server code is here:
[WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public static MyObject Get(string path) { MyObject foo = new MyObject(); return foo; }
Normally this would not be a problem, except that I am accessing a WebMethod, and it doesnt have the capability to return a jsonp response (meaning it has no way to attach the callback function to the response. Now, if this was a manual response, I could hack it up and attach the parameter, but I am taking advantage of the built-in serialization, so no way to mess around with the response. [URL]
Let me just stress the fact that this code works. The only problem is jQuery treating this request as cross domain. But Why? UPDATE: Well, after many more hours and more testing I have narrowed this issue down to it being a bug in jquery 1.5.1. I did some testing with older versions (all 1.4 versions) and I had no problem, the request was made using JSON, and the response was received successfully. What could be the change they made that would consider this request a CORS?
I know that dynamic buttons and buttons in general don't use a typical postback and they post through the page.request.form. Okay, so in visual studio, I was able to determine that page.Request.form and in the all-keys property, i SEE my button there. It is the last item in all-keys.
When I am clicking this dynamic button which is in an updatepanel, the script below does not detect it as a button, it is still showing it as null:
public static Control GetPostBackControl(Page page) { Control control = null;
[Code]....
but here is the kicker, when I am traversing through the object, I am looking at the object C and the property 'ctl'. The ctl is showing me a value of "ButtonRow_0Col0" and it is of type string. This is good! But , the 'c' control object still says 'null'.
I have this select statement which joins two tables and produces one column as its result. What I'm figuring out is how to add this data into another table as a new column. The output of the select statement and the table I'm going to transfer the data to has the same number of rows. Should I put it first in a temporary table? This column shouldn't allow nulls also.
I've built an ASP.NET application that's using Forms Authentication. In our hosting account control panel, I set up an automated task that requests a web page once per week. When the page loads, a number of emails are sent out.I'd just like to know if there's any way to determine in the code-behind if the request is coming from the local machine (as with Windows authentication). Using a separate web.config file in the page sub-directory with Windows authentication mode doesn't work.
I am developing an web application using VB.NET in which user have to confirm the email address they provide to activate the account, in short I have to send an email for activating there account. I am all set with the logic and codes, the only trouble is I just realise that i need a mail server and domain to be able to send email.
To be honest with you all i need now is something to try if the application is working and obviously for demo. I havent got any domain yet and no intention of buying one.