I am writing a http module, Want to find out how can i capture a URL and the do a redirect in case of certin conditions met?
View Complete Post
I'm in the middle of migrating servers and on the new server Response.Redirect is extremely slow. It takes around 20 seconds for the browser to get the redirect. This is something that was quick on the existing server. It's an ASP.NET 2.0 application, both servers are running IIS6.
Additionally, if I "manually" do the redirect, it's fast. For example:
takes around 20 seconds on the new server
Response.Status = "302 Moved Temporarily";Response.AddHeader("Location", url);Response.End();
is fast on the new server.
Any ideas why Response.Redirect would be so slow on the new server?
I've set in the web.config:
<!-- User Authentication -->
<forms loginUrl="~/Page/View/Content/Login.aspx" timeout="2880" requireSSL="true" />
This works fine. If there is no ssl connection, the login form doesn't continue. But I would like to check if ssl is active (in codebehind) and, if it's possible, to automatically the user to the https page if he's currently on http. (I could do this job by manually redirect with page.response("https://url.../login.aspx"); but this is not really generic. For example if the webapp is moved to another domain it doesn't work anymore... I'm looking for something like: FormsAuthentication.RedirectWithSSL(); or so... :D)
I am trying to save values into a Profile on Page1, then redirect to Page2 and access those values. However, after the page redirects the profile values are blank as if they were never saved. When stepping through the code I can see that they are being save on Page 1.
I suppose I could use session variables to store the information but I don't understand why saving the profile doesn't work.
private void PayWithPayPal()
ProfileCommon profile = this.Profile;
if (Global.CurrentUserName.Length > 0)
profile = this.Profile.GetProfile(Global.CurrentUserName);
profile.FirstName = uxFirstNameShipping.Text;
profile.LastName = uxLastNameBilling.Text;
profile.ShippingAddress.AddressLineOne = uxAddressLineOneShipping.Text;
profile.ShippingAddress.AddressLineTwo = uxAddressLineTwoShipping.Text;
profile.ShippingAddress.City = uxCityShipping.Text;
profile.ShippingAddress.State = uxStateShipping.Text;
profile.ShippingAddress.ZipCode = uxPostalCodeShipping.Text;
protected void Page_Load(object sender, EventArgs e)
Learn how to create a workflow that uses InfoPath forms and other office documents for passing data to targeted activities and for use in Office documents.
MSDN Magazine June 2008
I need to open a new window with Response.Redirect, Is it possible?
I have a custom hierarchical data source based on the msdn example (http://msdn.microsoft.com/en-us/library/system.web.ui.hierarchicaldatasourcecontrol.aspx). An event can be raised in the DataSourceView. If that occurs, I want to display a message on the web page.
The example is that I have a page with a TreeView control which uses a custom hierarchical datasource. If the user selects a node that they are not allowed to select, the underlying datasource will throw and error.
I want to capture this and add a message to the page. The Page_Error event is raised, but there are no eventargs.
Anybody know how to capture such an event?
An alternative approach, although not quite specific enough, is to set a flag during the datasource load event (indicating the datasource is loading) and test for this flag in the Page_Error routine.
Hello, I will try to be as clear as I can be. I'm sure this question has been asked but I can't find a suitable answer for this particular situation.
I need to be able to redirect the browser to a new 3rd party page while at the same time supplying a cookie required for some form of authentication on the 3rd party site.
I have managed to get this to work in the following manner:
'SessionID is predetermined by another HttpWebRequest/Response
Dim sessionCookie As New Cookie("ezproxy", sessionID.Substring(1), "/", ".someother.site")
Dim CookieJar As New CookieContainer
rRequest = HttpWebRequest.Create("where I want to go")
rRequest.CookieContainer = CookieJar
rRequest.Method = "GET"
'Make the request and get the response.
rResponse = rRequest.GetResponse()
If (rResponse.Cookies.Count <> 0) Then
For Each cook
Hello,I'm fairly new to ASP.NET and i'm using the Membership Provider. I have the need to do similar to some banking sites. Baically I need to track "authorized" computers/ip's for a user. If the user accesses the site form a recognized Computer/IP then the user is allowed into the app after successful login. If the computer/IP is not recognized I need to redirect them to a screen to answer the security question setup in fhte Membership Provider.Has anyone done anything like this or can anyone point me to any examples? I did a search, but can't seem to find anything.
My idea is to maintain a list of authorized computers/IP addresses and check them on initial login. If the IP address isn't found I can redirect them to the questions. My concern is that they are then actually authenticated and could enter any of the site URL's as an authenticated user.
Any suggestions greatly appreciated.
We are going live with our new site on internet shortly and we wnat to do an 301 redirect from old url to our new url. e.g. our url
http://www.abc.com/def/ and the new url
http://www.abc.com/efg/klm/zzz.aspx [The domain is same]. It will raise a 404 if we are not set the 301 redirect.
Please let me know how can we do this?
I have a ReportViewer which I'm pulling into a C# WPF project, and would like to be able to capture the row a user clicks on in the reportViewer, but have had no success tapping into the mouse event handlers. Does anyone know how to accomplish this? This MSDN link seems to imply that ReportViewer(winforms) supports mouse click events such as Click, DoubleClick..etc. http://msdn.microsoft.com/en-us/library/microsoft.reporting.winforms.reportviewer_events.aspx, but I've not had any luck.If mouse events are not currently supported, does anyone know when they will be, and whether properties such as SelectedItem or SelectedIndex would also be exposed?Thanks for the help.
I recently tried to activate the MobilityRedirect feature in order to let users type /m to get the mobile view of a site. It works fine on the base site of my site collection but nowhere else. I used the following command in stsadm:
stsadm -o activatefeature -name MobilityRedirect -url http://(my server name)
Am I missing something really silly? I can't imagine that I have to activate it on each site individually.