I am using this simple code to redirect http to https on my billing landing page:
if (!Request.IsSecureConnection)
{
// send user to SSL
string serverName =HttpUtility.UrlEncode(Request.ServerVariables["SERVER_NAME"]);
string filePath = Request.FilePath;
Response.Redirect("https://" + serverName + filePath);
}
...
I have radiobuttonlist that i have set to autopostback, but when a user clicks a button, there is no postback.
Any suggestions?
...
Hello,
How do i configure connection string for Asp.Net Membership Provider? Do i have to write it by hand or any tool is available in Visual Studio where i can specify connection string as well as algorithm used to store password?
I read one article and it specifies this connection string :-
<configuration>
<connectionStrings>...
Microsoft released their out of band release to fix the security flaw in ASP.NET the yesterday.
What methods did Microsoft use to end the viability of this vector?
...
Platform: Server - ASP.NET 3.5 / C#; client side - javascript/jQuery
This is what I want to do
Scramble a string in ASP.NET WebMethod (called through a jQuery Ajax call) before sending to the client
Unscramble it in javascript and display
I'm not looking at any sort of heavy duty encryption AES SHA whatever. I'm only interested in s...
I've built an ASP.NET MVC application with MVC 2.0 and Fluent NHibernate (hided behind repositories for some reasons). The application represents a quite complex domain with some different objects like users, messages, comments, files and appointments.
Now I want to implement a fulltext search which is enabling the user to find easily a...
I'm using Entity Framework 4 for a simple app and would like to bake my connection credentials into the following connection string:
<connectionStrings>
<add name="MyEntities"
connectionString="metadata=res://*/MyDataModel.csdl|res://*/MyDataModel.ssdl|res://*/MyDataModel.msl;provider=System.Data.SqlClient;provider conn...
When I start a new ASP.NET project in Visual Studio 2010, I can either create a new ASP.NET Web Site or an ASP.NET Web Application.
What's the difference between these two project types? Why would I choose one over the other?
Please note: this question is an exact duplicate of this one, but I'm asking specifically about Visual Studio 2...
I have a 3 level nested master pages and a content page. parent1 is the top parent, parent2 is parent of parent3 and parent3 is the parent of the content page.
I get an error 'Cannot find ContentPlaceHolder xxx...' where xxx is a ContentPlaceholder. It resides in parent2 and content page is trying to fill it.
Can content pages only u...
For typical examples I see of SqlDataSource, LinqDataSource...
EVERY example deal with how to make changes to a Customer table where the Gridview/RADgrid directly represents the customer..
But in my case I have stored procedure which show data from multiple tables and make changes to multiple tables so it seems I am not a canidate for ...
It seems that when using the following NHibernate query, I do not get a root entity when the left outer join has no records.
ICriteria critera = session.CreateCriteria(typeof(Entity));
criteria.CreateCriteria("SubTable.Property", "Property", NHibernate.SqlCommand.JoinType.LeftOuterJoin);
criteria.Add(Expression.Not(Expression.Eq("Prop...
There is a lot of discussion about todays fix for ASP.NET to prevent an attack that can be used to get the encryption keys from an application. In one discussion I read that it could also be used to make the WebResource.axd handler return any file in the application by forging the request parameters to point to a known file location (whe...
My app fails at this line of code:
Dim objConnection As New SqlConnection(Application("ConnString"))
My connection string is:
"Server=testAITSQL;Database=SSCommerce;UID=PlanoWebApp;PWD=XXXXXXXX;"
I googled this problem and the solution for it was having a malformed connection string where the "provider" was being specified when it ...
Hi,
i was building a new small website for an existing client, and thought about building it with ASP.Net 4.
But in the apppoolsettings, i could only choose framework 2.0, so i guessed that 4.0 is not available on the server.
Is it something i have to install on the server, or will it be installed via windows update somewhere in time?
...
I have an asp.net 4.0 web site that generates email alerts based on several different events throughout the site. I use the following code in a Utility.cs class that lives in my App_Code folder. Subject, body, and mailto are parameters being passed into the method.
try
{
var mailmessage = new MailMessage();
mailmessage.From("a...
Hello all,
I have spent a day and a half trying to resolve this issue. Bascially have an ASP.net website with Forms Authentication on IIS7 using Framework 4.0.
The Authorization stuff seems to be working perfectly for every scenario with the exception of hitting it with no document specifed (Should resolve to Default Doc).
For exampl...
Hello,
I'm having a problem of losing session variable on my website. It append at random times so there is no particular behavior that cause this. What can be the cause of this session lost?
I've read everywhere on this site that I could put my session in "sql server" mode so everything is written on the server, can it be a solution?
...
Ok, I am an experienced web developer but sometimes ASP.Net is tricking me.
I have a master page in asp.net. Then I have a page based on that master page (home.aspx). Now in home.aspx.cs I want to access the asp:content controls to add controls programmatically.
Aspx looks like this:
<asp:Content ID="leftCol" ContentPlaceHolderID="c...
This is related to this question but I've got specific information now.
I've got a problem where my site won't load for a second visitor if the page is running a report for the first visitor. This is what happens.
User 1 comes to the site
User 1 runs a report that takes 30 seconds.
User 2 comes to the site
User 2 waits until user 1 re...
Folks,
I have an ASP.NET project which is pretty n-tier, by namespace, but I need to separate into three projects: Data Layer, Middle Tier and Front End.
I am doing this because...
A) It seems the right thing to do, and
B) I am having all sorts of problems running unit tests for ASP.NET hosted assemblies.
Anyway, my question is, w...