Website Returns 302 Instead Of 200?

Aug 5, 2010

I used a Http Header check tool to check the headers of my webpage and guess what. In every request the response was 302 instead of 200.

domain.con
www.domain.con
http://www.domain.con

So, am i missing something here? I have not placed any redirect in any way.

So where the f#$% my website redirects? Is there a security hole?

UPDATE: While googling found this one

View 4 Replies


Similar Messages:

IIS Configuration :: JScript Serialize Returns Null When Website Hosted On Server?

Feb 25, 2016

when application runs on local machine, it returns data correct, but when website hosted on server then it cannot retunrs data in jscript serialize

C#
JavaScriptSerializer jscript = new JavaScriptSerializer();
List<ListItem> items= new List<ListItem>();
return jscript.Serialize(items);
Javascript
var jsdata = JSON.parse(items);

View 1 Replies

Web Forms :: Routing 4.0 / Deploy Website On A Remote Server ( Integrated Pipeline ) It Returns With 404 Error?

Sep 8, 2010

When I run my website on local server asp.net routing works very well, but when I deploy it on a remote server ( asp 4.0 integrated pipeline ) it always returns with 404 error.

My url route is very simple, a stored procedure gets image's id and then displays it.

Global.asax:

[Code]....

Default.cs:

[Code]....

View 6 Replies

Search Functionality - Search The Whole Website And Returns The Results

Jan 26, 2010

I created a website. I would like to include a search box that searches the whole website and returns the results.

View 2 Replies

New Website Attach With Existing Website / Where Attached Website Is Behaving As Pluggable?

Feb 26, 2011

1 new website attach with existing website..where attached website is behave as pluggable. and used anywhere in any website?

View 7 Replies

SharePoint External Facing Website Ability To Go Full Website And Non Full Website When Accessed In Mobile Device?

Dec 15, 2010

I've got an external site that's built in SharePoint 2007. the user of the site need to have an option to view the full site when accessed from a mobile device. I am thinking of just creating a button control to do this. The question is, what would be the best solution to do this?

View 1 Replies

C# - WCF Service Returns 400 Bad Request

Mar 18, 2011

I've got this application that works locally and when deployed and using a .mdf SQL Express database file (which I usually use for testing purposes). However, when I change it to work with our SQL Server 2008 the app works but the service doesn't. For example if in my code behind of a page I have a button that adds data to a table such as this it works fine:

public static string connString = @"Data Source=server1;Initial Catalog=Project;Integrated Security=True";
protected void btnAddProj_Click(object sender, EventArgs e)
{
using (var sqlc = new SqlConnection(connString))
{
sqlc.Open();
var cmd = sqlc.CreateCommand();
int intProjectID;
// Add the project info to the database
cmd.CommandText = "INSERT INTO tblProject VALUES(@ProjName,@ProjTeam,@ProjStart,@ProjEnd)";
cmd.Parameters.Add("ProjName", System.Data.SqlDbType.NVarChar).Value = txtProjName.Text;
cmd.Parameters.Add("ProjTeam", System.Data.SqlDbType.Int).Value = ddlTeamSupported.SelectedValue;
cmd.Parameters.Add("ProjStart", System.Data.SqlDbType.NVarChar).Value = txtStartDate.Text;
cmd.Parameters.Add("ProjEnd", System.Data.SqlDbType.NVarChar).Value = txtEndDate.Text;
cmd.ExecuteNonQuery();
}
}

My web.config is setup to use impersonation on that server and all works perfectly well. However, for my service the query doesn't seem to return anything and I get a 400 Bad Request error. The code for the jquery is:

$.ajax({
type: "POST",
async: false,
url: "Services/ProjectService.svc/test",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
console.log(data);
}
});
And for the Service:
[ServiceContract]
public interface IProjectService
{
[OperationContract]
[WebInvoke(ResponseFormat = WebMessageFormat.Json)]
ArrayList test();
}
public static string connString = @"Data Source=server1;Initial Catalog=Project;Integrated Security=True";
public ArrayList test()
{
var sqlc = new SqlConnection(connString);
sqlc.Open();
var cmd = sqlc.CreateCommand();
cmd.CommandText = "SELECT ProjectID FROM tblProject";
var reader = cmd.ExecuteReader();
ArrayList temparray = new ArrayList();
while (reader.Read())
{
temparray.Add(reader[0]);
}
sqlc.Close();
return temparray;
}

If instead of querying the database I have the service just return static data then it works fine. What could cause my service not to be able to connect to the database when the rest of the code behind for the app works?

View 3 Replies

MVC :: TryUpdateModel Returns True But Does Nothing?

Jan 16, 2011

I have a strongly typed Edit view that expects a viewmodel class. On its post action, I want it to use TryUpdateModel to update the database with the new info. When debugging, TryUpdateModel returns true, but when I look in the database, nothing happened.

This is the controller Action

[Code]....

why this doesn't persist the changes back to the database?

View 2 Replies

C# - SelectionList Always Returns NULL - How To Fix It

Jul 20, 2010

I have a very strange issue where SelectionList always returns NULL when i try check its Selected Item/Value. I Googled a bit and I found out that when i click the submit button, the page is being refreshed and the SelectionList is being data bound again so it will revert back to its original behavior.

Then i tried enclosing the binding code in the Page_Load event in a !IsPostBack but still when i try to access the Selected property it is null and an exception is thrown.

My code goes something like this... (the braces are not matched properly)

static SelectionList[] Symptoms;
static string UserID = "";

cmbSymptoms1,cmbSymptoms2,cmbSymptoms3 and cmbSymptoms4 are SelectionLists. I took them in to an array of SelectionList and then set the properties.

I had to make them static or else when i click the button to update, they will not retain their values.

protected void Page_Load(object sender, EventArgs e)
{
if (this.IsPostBack == false)
{
//System.Diagnostics.Debug.WriteLine("Not IsPostBack");
if (Request.QueryString["id"] != null && Request.QueryString.ToString() != "")
{
//System.Diagnostics.Debug.WriteLine("id query string is not null :- " + Request.QueryString["id"]);
myclass = new Class1();...........

View 1 Replies

C# - HttpWorkerRequest.GetBytesRead() Always Returns?

Jun 9, 2010

Anyone know why HttpWorkerRequest.GetBytesRead() always returns 0, even during and after a file upload? Would like to use this method to build a progress bar.

View 1 Replies

Any Webservice That Returns JSON?

May 11, 2010

Does anyone know of free webservice that returns a list in the form of JSON? I have searched many webservice sites but they all return xml. Geonames.org is not required.

View 3 Replies

Array Returns 0 Instead Of Assigned Value?

Aug 18, 2010

I assigned a int value to to one of the cells in an array and then output that value to a label. The label correctly displays that value however when I try to get that value later in a different method the cell returns a 0. I think that the problem is that I shouldn't of made the array on the outside of a method; I checked the code that deals with the array about 3 times and it all seems fine. how I should create, get, and set this array. I was setting the value of the cell like this

arrayForXps[0,1] =Convert.ToInt32(ddl_att_desLvl.SelectedValue); //This value is never zero.

I was getting the value like this Label.Text = Convert.ToString(arrayForXps[0,1]);

[Code]....

View 1 Replies

SQL Server :: SCOPE_IDENTITY() Always Returns 0?

Mar 3, 2011

I am trying to return the identity value of a inserted record for the first time in ASP.NET but it always returns 0, I can see in the database that a record is being inserted and the identity value is not 0.

Stored Proc:

[Code]....

Code Behind:

[Code]....

View 8 Replies

C# - 'Contains' Method Returns False?

Jan 16, 2011

I've an EntityCollection< T > which contains an element but the Contains method returns false.

I've overriden T's 'Equals' method but the 'Contains' method does not call it (while it's said so in documentation).

When I do foreach (T x in coll), x.Equals(element) returns true.

code:

contains(object entCol, object val)
{
var coll = (ICollection<GraphicSockets>)entCol;
var socket = val as GraphicSockets;
foreach (GraphicSockets sock in coll)
socket.Equals(sock); //true for first element, GraphicSocket's Equals function called
coll.Contains(socket);//false, Equals function not called}

the code i'd actually like to use is

private static bool contains(object entCol, object val)
{
Type entColType = typeof(EntityCollection<>).MakeGenericType(val.GetType());
MethodInfo contains = entColType.GetMethod("Contains");
return (bool)contains.Invoke(entCol, new object[] { val });
}

this worked once but stopped when i started using wcf, i wonder how this contains method works.....

View 2 Replies

C# - Telerik RadAjaxPanel Returns 404?

Oct 15, 2010

I'm trying to do a RadAjaxPanel ajaxRequest (invoked on the client) to call the server event-handler. I'm getting a 404. I do have a server-side AjaxRequest handler defined but it never gets call because of something with the request. What do I have to do to figure this out?

.NET 4.0, IIS 7.5, latest telerik.

View 1 Replies

Vb.net Function Returns Either String Or Nothing?

May 25, 2010

I'm tring to create a vb.net 3.5 function that can return either a string or nothing.

Public
Shared
Function MakeLookupField(ByVal pasString
As
String)

[Code]....

What can I set the return variable to return either a string or null value

View 7 Replies

MVC :: Typing A URL Some How Returns /Home?

Mar 5, 2011

I have a weird problem with my MVC application.In my _Layout.cshtml file I have created 3 menu links and each points to a location. On my personal PC clicking each link will browse to the specifc page without any issues. However, when I deployed my app to a hosting website. The first 2 links work fine but the 3rd one returns me to ~/Home

Using IE developer tools here is the network capture:

Request: GET /myapp/mylink HTTP/1.1

Accept: imaged/jped etc..

Refer: /myapp/home

The response is as follow:

Response: HTTP/1.1 302 Found

Location: /myapp/home

I am not really sure why am I getting a HTTP 302 and causing a redirect to /myapp/home.

View 1 Replies

Asp.net - Dataset Column Always Returns -1?

Aug 20, 2010

I have a SQL stored proc that returns a dataset to ASP.NET v3.5 dataset. One of the columns in the dataset is called Attend and is a nullable bit column in the SQL table. The SELECT for that column is this:

CASE WHEN Attend IS NULL THEN -1 ELSE Attend END AS Attend

When I execute the SP in Query Analyzer the row values are returned as they should be - the value for Attend is -1 is some rows, 0 in others, and 1 in others. However, when I debug the C# code and examine the dataset, the Attend column always contains -1.

If I SELECT any other columns or constant values for Attend the results are always correct. It is only the above SELECT of the bit field that is behaving strangely. I suspect it has something to do with the type being bit that is causing this. So to test this I instead selected "CONVERT(int, Attend)" but the behavior is the same.

I have tried using ExecuteDataset to retrieve the data and I have also created a .NET Dataset schema with TableAdapter and DataTable.

View 2 Replies

MVC :: Route Returns A 404 Error Sometimes?

Dec 19, 2010

when the server reboots, one route sometimes returns a 404 until the site is manually restarted. why is that? using mvc 3 rc1 and razor views.

View 16 Replies

VS 2010 - Returns A Comma Instead Of ID

Aug 5, 2014

My problem is that all of a sudden the __EVENTTARGET isn't working. It returns a comma for some controls (that arent given that ID of coure). At first I didn't have the energy to investigate this, I just made sure the comma was handled. But that was before I needed another control (asp:button) to behave in a certain way. Now the button returns a comma as ID, which triggers an event that I don't want for the button_click.

View 5 Replies

C# - Variable Returns To Its Default Value (zero) In Other Scopes?

Sep 22, 2010

Can I assign a value to a variable (int) and never lose this value inside any scope? the problem is I am assigning the value to the variable in some scopes but the variable returns to its default value (zero) in other scopes..

protected void Button_AddNewCourse_Click(object sender, EventArgs e)
{
ID = 10;
}

so when I am trying to use ID in other functions it falls back to zero

protected void AnotherFunction(object sender, EventArgs e)
{
// Variable ID here is zero
}

View 3 Replies

MVC :: Static Content Returns A 500 Error?

Nov 16, 2010

I think I might be missing something obvious but I'm not sure. The other day I was trying to run throught the windows live ID domain verification process on my asp.net mvc site. Part of the process requires you to download a text file and put it in the root of your site which your domain points to. When I would click the verify button in the windows live app verification process it would fail. In a browser, I could hit the request the text file and get a 200, which puzzle me. I then used this site http://www.internetofficer.com/seo-tool/redirect-check/ to check for any redirection issues. Suprisingly when I enter in the url to check, in my case http://www.whatitcoststobeme.com/741KXPjf42zgZRnV6O1LsO92.txt, it returns a 500 error. I ran this same test against a non-MVC site and the verificaton process passed plus the redirection checker return a 200 ("direct link" on their site). The environment this was tested in was IIS7.

why this is happening with static content on a ASP.NET MVC site? I want to say it's something to do with the url routing handlers.

View 6 Replies

C# - The IndexOf() Method Returns -1 All The Time

Aug 26, 2010

i have two data tables with the same structure

the first one has one row of the second one

the second one has set of rows

what i want is to get the row which comes next to the row of the first data table in the second data table.

the first data table his name is :: temp

the second data table his name is :: dt

i do the following:

DataTable temp = new DataTable();
temp = dt.Clone();
DataColumn[] keyColumn = new DataColumn[1];
keyColumn[0] = temp.Columns["photoId"];
temp.PrimaryKey = keyColumn;
temp = (DataTable)(Session["currentImage"]);
DataRow[] drr = new DataRow[1];
index = dt.Rows.IndexOf(temp.Rows[0]);

but the index always comes with one value = -1

although the temp.rows[0] its contents changed all the time

when i write dt.Rows.IndexOf(dt.Rows[1]) for examble i get 1

but this is not what i want to do ,, what i want to do exactly is to get the datarow next to the datarow of the first dataTable in the second dataTable

View 2 Replies

Mvc Json - Color Always Returns Null

May 22, 2010

I am working on a mvc project, and having problem with json. i have created a demo project with list of colors

public JsonResult GetResult()
{
List<string> strList = new List<string>();
strList.Add("white");
strList.Add("blue");
strList.Add("black");
strList.Add("red");
strList.Add("orange");
strList.Add("green");
return this.Json(strList);
}
i am able to get these on my page, but when i try to delete one color, that is when i send the following using jquery
function deleteItem(item) {
$.ajax({
type: "POST",
url: "/Home/Delete/white",
data: "{}",
contentType: "application/json; charset=utf-8",
success: ajaxCallSucceed,
dataType: "json",
failure: ajaxCallFailed
});
}

the controler action public JsonResult Delete(string Color) {} Color always returns null, even if i have specified "/Home/Delete/white" in the url. i know i am doing something wrong or missing something, but not able to find out what.

View 4 Replies

ListBox Always Returns First Value (-1 Selected Index)

Feb 19, 2011

I have two ASP.NET ListBoxex in a usercontrol.

databinding event fires once. i am sure and i did trace.

but listbox always returns first value !

it is strange for me.

and i don't know how to fix it.

[code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved