Quantcast
Channel: Configuration and Deployment
Viewing all 3561 articles
Browse latest View live

Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified

$
0
0

Hi All,

I tried to deploy ASP MVC project using web deployment package to a destination machine(virtual windows XP server 2008 R2). An error popped up. I Have set the local copy property of this dll true, but still the error remains. 

Please help me regarding this.

Thanks.


The compiler failed with error code 1 on Asp .Net hosted site

$
0
0

Hello,

         I have created website in .Net 2.0. When we hosted our published website folder or server IIS it gives an error as follows:

Server Error in '/' Application.


Compilation Error

Description:An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: The compiler failed with error code 1.

Show Detailed Compiler Output:

C:\Windows\SysWOW64\inetsrv> "C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\55e9a789\e680238b_4ea3d001\DataAccessLayer.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\a0c6a9a5\211bda37_25d4d001\App_Web_masterpageaccordion.master.a78b30ac.DLL" /R:"C:\Windows\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\22f7f02e\cf4a44ff_25d4d001\DundasWebChart.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\df6be54c\900f3fc3_4ea3d001\ephtmltopdf.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\f3830c6a\0393d000_27d4d001\TIPLPDF.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\da675a70\e8e0ae97_24d4d001\App_Licenses.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\028c0eca\fc831506_26d4d001\OptionDropDownList.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\45d03fcd\cadf22b9_24d4d001\App_Code.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\0ed9951e\406a61a1_25d4d001\App_Web_uc_attachfilelist.ascx.6907505d.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\62bee4c8\154f5370_24d4d001\AJAXExtensionsToolbox.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\adfb07b1\2d2cf88d_24d4d001\AjaxControlToolkit.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\f2a7e3c4\12d94043_26d4d001\itextsharp.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\041dac69\94568ba2_25d4d001\App_Web_uc_easemsgbox.ascx.6907505d.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Extensions.Design\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.Design.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\4b1e18e2\886d7ed8_24d4d001\App_Web_bustravelreq.aspx.a78b30ac.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\4be5e66c\cf0802ff_26d4d001\TIPL.MessageBox.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\a0d28151\64e834a0_25d4d001\App_Web_ucapprover.ascx.6907505d.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing.Design\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.Design.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\94497cc4\b9b1dacc_25d4d001\FreeTextBox.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\App_Web_masterpageaccordion.master.a78b30ac.7ch5x-_f.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\0d8e7357\09c193f4_26d4d001\TIPL.DataAccessLayer.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\App_Web_ydrf8a7o.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\App_Web_uc_attachfilelist.ascx.6907505d.tet-oyyv.dll" /R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\64870bf6\11cbcbfa_4ea3d001\TIPL.SendMail.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\3e857369\a69ea8fa_26d4d001\TIPL.ErrorHandler.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\65295757\79ad6190_24d4d001\App_global.asax.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\629d827b\d4c4c4c4_4ea3d001\ErrorHandler.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\assembly\dl3\3dd58942\f6b37d96_24d4d001\App_GlobalResources.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\App_Web_uc_easemsgbox.ascx.6907505d.jc_obbbg.dll" /out:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\App_Web_bustravelreq.aspx.a78b30ac.5n60wozo.dll" /D:DEBUG /debug+ /optimize- /win32res:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\njoliwt8.res" /w:4 /nowarn:1659;1699;1701  "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\App_Web_bustravelreq.aspx.a78b30ac.5n60wozo.0.cs" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c73a6aea\931f7e78\App_Web_bustravelreq.aspx.a78b30ac.5n60wozo.1.cs"

Version Information: Microsoft .NET Framework Version:2.0.50727.8009; ASP.NET Version:2.0.50727.8015

Server configuration is updated with these properties of IIS & app pool as follows:

For App Pool property:

                Eable 32 - Bit Application = True

For IIS:
  World Wide Web (WWW) Services enable all Application Dev Features In IIS.

The web.config file is as follows:

<?xml version="1.0"?><!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
--><configuration><configSections><sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/><sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/><section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/><section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections><appSettings/><connectionStrings/><system.web><!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        --><customErrors mode="Off"/><pages><controls><add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></controls></pages><compilation debug="true"><!--<compilation debug="true">--><assemblies><add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation><httpHandlers><remove verb="*" path="*.asmx"/><add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/></httpHandlers><httpModules><add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></httpModules>		</system.web></configuration>

On local IIS along with these properties works finely without any errors, but when it is uploaded to server IIS it gives the above error. Is this issue solvable or need to do the changes other than above. Help is appreciable.

          Thank you in advance.

While publishing Dll's are not copied

$
0
0

Hi All,

When I am publishing from visual studio 2012 Ajax toolkit dll and evohtmltopdf(third party tool for PDF)dll are not copied to publish folder. I have to copy these manually and put it on server every time. Can  any one give a guess why this is behaving like so ? Do I need to give any permissions or anything else ?

How to set Owner to files and directories on shared path.

$
0
0

Hi All,

I am creating directories and uploading files on shared path.

I want to set the Owner to files and directories. How to set ?

Path: \\000.000.0.00\Upload

I want to set because whenever I am reading owner I am getting "Builtin\Admin" coz by default it setting. It is not taking current one.

Is there any other way how get ower for files and folder.

Thanks,

Harish Patil

Activate MVC Web site on IIS 7

$
0
0

In VS2013 with update 5 I created an MVC 5 Web site. I published it (file system) to a folder on my computer.

I had IIS 7 installed on one of our servers. I installed .Net 4.5.2 on the server.
I copied the folder contiaining my published Web site to \inetpub\wwwroot on the server.

Now what do I do to give the Web site a URL and otherwise make it active as a Web site?

Thanks,

NetworkError: 500 Internal Server Error

$
0
0

Hello.

We've recently deployed an application to a Windows 2012 R2 Server running IIS8 production box that isn't rendering css or image files up to the browser.

It renders fine in development and validation, however when we put it into production we get an error (Firebug and Fiddler) of:

NetworkError: 500 Internal Server Error - http://website/app/masterpage.css

The IIS log entry looks like this:

2015-08-13 18:55:05 172.30.87.77 GET /app/masterpage.css - 80 - 172.25.69.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64;+rv:33.0)+Gecko/20100101+Firefox/33.0 http://website/app/Default.aspx 500 19 183 0

I've been searching the web to try and find similar issues and it seems that in order to drill down into this error, I might need to find an HRESULT code, however I cannot determine where this code would be found.

We've looked in the Windows EventViewer, however do not see any 500 Errors there for IIS and cannot see any HRESULT codes in Fiddler or Firebug.

I guess the other option would be to turn on FailedRequestTracing in IIS 8

Thanks for any guidance on this issue.

ASP.NET

$
0
0

I want to host my ASP.NET website in mywindowshosting.com, which is developed by using local IIS(http) web server but if i want to upload it i get an error that is :-"Check sever name Or proxy setting if it is correct then server may be temperarly unavailable " How can i resolve this problem.

profile common could not be foundql

$
0
0

I am trying to update a site that worked a year ago using visual studio 2012.  I have not hooked up the sql database yet. Not sure if that is the problem

Below is the file that is causing the error.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace EP.BumplesMagazine.BusinessLogicLayer.Store
{
[Serializable]
public class ShoppingCartItem
{
private int id = 0;
public int Id
{
get { return id; }
private set { id = value; }
}

private String title = "";
public String Title
{
get { return title; }
private set { title = value; }
}

private String sku = "";
public String SKU
{
get { return sku; }
private set { sku = value; }
}

private decimal unitPrice;
public decimal UnitPrice
{
get { return unitPrice; }
private set { unitPrice = value; }
}

private int quantity = 1;
public int Quantity
{
get { return quantity; }
set { quantity = value; }
}

public ShoppingCartItem(int id, String title, String sku, decimal unitPrice)
{
this.Id = id;
this.Title = title;
this.SKU = sku;
this.UnitPrice = unitPrice;
}
}

[Serializable]
public class ShoppingCart
{
private Dictionary<int, ShoppingCartItem> items = new Dictionary<int, ShoppingCartItem>();
public ICollection Items
{
get { return items.Values; }
}

/// <summary>
/// Gets the sum total of the items' prices
/// </summary>
public decimal Total
{
get
{
decimal sum = 0.0m;
foreach (ShoppingCartItem item in items.Values)
sum += item.UnitPrice * item.Quantity;

return sum;
}
}

/// <summary>
/// Adds a new item to the shopping cart
/// </summary>
public void InsertItem(int id, String title, String sku, decimal unitPrice)
{
if (items.ContainsKey(id))
items[id].Quantity += 1;
else
items.Add(id, new ShoppingCartItem(id, title, sku, unitPrice));
}

/// <summary>
/// Removes an item from the shopping cart
/// </summary>
public void DeleteItem(int id)
{
if (items.ContainsKey(id))
{
ShoppingCartItem item = items[id];
item.Quantity -= 1;
if (item.Quantity == 0)
items.Remove(id);
}
}

/// <summary>
/// Removes all items of a specified product from the shopping cart
/// </summary>
public void DeleteProduct(int id)
{
if (items.ContainsKey(id))
items.Remove(id);
}

/// <summary>
/// Updates the quantity for an item
/// </summary>
public void UpdateItemQuantity(int id, int quantity)
{
if (items.ContainsKey(id))
{
ShoppingCartItem item = items[id];
item.Quantity = quantity;
if (item.Quantity <= 0)
items.Remove(id);
}
}

/// <summary>
/// Clears the cart
/// </summary>
public void Clear()
{
items.Clear();
}
}

public class CurrentUserShoppingCart
{
public static ICollection GetItems()
{
//return (HttpContext.Current.Profile as ProfileCommon).ShoppingCart.Items;  (the error is here and also the next profile common statements
}

public static void DeleteItem(int id)
{
(HttpContext.Current.Profile as ProfileCommon).ShoppingCart.DeleteItem(id);  
}

public static void DeleteProduct(int id)
{
(HttpContext.Current.Profile as ProfileCommon).ShoppingCart.DeleteProduct(id);
}
}
}

Here is the web config if that will help.

<?xml version="1.0"?>

<configuration>
<location path="EditProfile.aspx">
<system.web>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
</system.web>
</location>

<location path="ChangePassword.aspx">
<system.web>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
</system.web>
</location>

<location path="OrderHistory.aspx">
<system.web>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
</system.web>
</location>
</configuration>

I hope you can help me.

Jen


Object reference not set to an instance of an object.

$
0
0

Hi ,

I deployed my dot net project on sharepoint but it is not working there. I am unable to resolve the following error:


Object reference not set to an instance of an object.

[NullReferenceException: Object reference not set to an instance of an object.]
   WebTrackingTool.DBFiles.DBRepository.GetDueInvoices(String query) in C:\Project\WebTrackingTool\WebTrackingTool\DBFiles\DBRepository.cs:117
   WebTrackingTool.TrackerView.DisplayReminder(DateTime dateTime) in C:\Project\WebTrackingTool\WebTrackingTool\Admin\TrackerView.aspx.cs:43
   WebTrackingTool.TrackerView.Page_Load(Object sender, EventArgs e) in C:\Project\WebTrackingTool\WebTrackingTool\Admin\TrackerView.aspx.cs:20
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

My cs file:

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace WebTrackingTool
{
public partial class TrackerView : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
GenerateColumns();
if (Session["Reminder"] == null || Session["Reminder"].ToString() == "")
DisplayReminder(Convert.ToDateTime(Session["LastLogin"]));

}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridTracker.PageIndex = e.NewPageIndex;
GridTracker.DataSource = Session["TrackerData"] as DataTable; //get datasource (list or datatable)
GridTracker.DataBind(); //bind data
}

private void DisplayReminder(DateTime dateTime)
{
string RemMessage = String.Empty;
if (dateTime.Date < DateTime.Now.Date)
{
DBFiles.DBRepository repo = new DBFiles.DBRepository();
DataSet ds = repo.GetDueInvoices();
DataTable dt = ds.Tables["TrackerDetails"];
dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
Session["DueInvoices"] = dt;
if (dt.Rows.Count > 0)
RemMessage += "REMINDER!! Due date approaching. ";

DataSet ds1 = repo.GetApproachingInvoices();
DataTable dt1 = ds1.Tables["TrackerDetails"];
dt1.PrimaryKey = new DataColumn[] { dt1.Columns[0] };
Session["UpcomingInvoices"] = dt1;
if (dt1.Rows.Count > 0)
RemMessage += "REMINDER!! Invoice date approaching. ";

DataSet dsReceipts = repo.GetPendingReceipts();
DataTable dtReceipts = dsReceipts.Tables["TrackerDetails"];
dtReceipts.PrimaryKey = new DataColumn[] { dtReceipts.Columns[0] };
Session["PendingReceipts"] = dtReceipts;
if (dtReceipts.Rows.Count > 0)
RemMessage += " " + dtReceipts.Rows.Count + " Receipts Pending. "; ///Change the reminder message as required

DataSet dsIPN = repo.GetDueInvoices();
DataTable dtIPN = dsIPN.Tables["TrackerDetails"];
dtIPN.PrimaryKey = new DataColumn[] { dtIPN.Columns[0] };
Session["PendingIPN"] = dtIPN;
if (dtIPN.Rows.Count > 0)
RemMessage += " " + dtReceipts.Rows.Count + " IPN Pending. ";
if (RemMessage == String.Empty)
RemMessage = "No pending requests.";

string cleanMessage = RemMessage.Replace("'", "\'");
Page page = HttpContext.Current.CurrentHandler as Page;
string script = string.Format("alert('{0}');", cleanMessage);
if (page != null && !page.ClientScript.IsClientScriptBlockRegistered("alert"))
{
page.ClientScript.RegisterClientScriptBlock(page.GetType(), "alert", script, true /* addScriptTags */);
}
Session["Reminder"] = "Yes";
}
}

#region GridSorting
protected void GridTracker_Sorting(object sender, GridViewSortEventArgs e)
{

//Retrieve the table from the session object.
DataTable dt = Session["TrackerData"] as DataTable;

if (dt != null)
{

//Sort the data.
dt.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression);
GridTracker.DataSource = Session["TrackerData"];
GridTracker.DataBind();
}

}

private string GetSortDirection(string column)
{

// By default, set the sort direction to ascending.
string sortDirection = "ASC";

// Retrieve the last column that was sorted.
string sortExpression = ViewState["SortExpression"] as string;

if (sortExpression != null)
{
// Check if the same column is being sorted.
// Otherwise, the default value can be returned.
if (sortExpression == column)
{
string lastDirection = ViewState["SortDirection"] as string;
if ((lastDirection != null) && (lastDirection == "ASC"))
{
sortDirection = "DESC";
}
}
}

// Save new values in ViewState.
ViewState["SortDirection"] = sortDirection;
ViewState["SortExpression"] = column;

return sortDirection;
}
#endregion

#region GridBind

private string[] GridDataKey = new string[] { "ID", "CustomerID", "InvoiceNo", "IPN", "PayableTo", "PONo", "Status", "Acknowledgement", "Invoice ReceiptDate" };
private string[] GridColName = new string[] { "S. No.", "Customer ID", "Invoice No.", "IPN", "Payable To", "PO Num", "Status", "Acknowledgement", "Invoice Receipt Date" };

private void GenerateColumns()
{
for (int i = 0; i < GridDataKey.Count(); i++)
{

BoundField bfield = new BoundField();
bfield.DataField = GridDataKey[i];
bfield.HeaderText = GridColName[i];
bfield.SortExpression = GridDataKey[i];
GridTracker.Columns.Add(bfield);
}

HyperLinkField bCol = new HyperLinkField();
bCol.HeaderText = "View";
GridTracker.Columns.Add(bCol);
HyperLinkField bCol1 = new HyperLinkField();
bCol1.HeaderText = "Edit";
GridTracker.Columns.Add(bCol1);
HyperLinkField bCol2 = new HyperLinkField();
bCol2.HeaderText = "Print";
GridTracker.Columns.Add(bCol2);
}
protected void GridTracker_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink link = new HyperLink();
link.Text = "View";
link.NavigateUrl = "/WebTrackingTool/Admin/TrackerEdit.aspx?id=" + e.Row.Cells[0].Text + "&FormMode=View&Invoices=All";
e.Row.Cells[9].Controls.Add(link);
HyperLink link1 = new HyperLink();
link1.Text = "Edit";
link1.NavigateUrl = "~/Admin/TrackerEdit.aspx?id=" + e.Row.Cells[0].Text + "&FormMode=Edit";
e.Row.Cells[10].Controls.Add(link1);
HyperLink link2 = new HyperLink();
link2.Text = "Print";
link2.NavigateUrl = "~/Admin/Form.aspx?id=" + e.Row.Cells[0].Text;
e.Row.Cells[11].Controls.Add(link2);
}
}
private void LoadData()
{
DBFiles.DBRepository repo = new DBFiles.DBRepository();
DataSet ds = new DataSet();
//string year = DateTime.Now.Date.Year.ToString("yyyy");
//string month = DateTime.Now.Date.Month.ToString("MMM").ToLower();
string year = tbYear.Text;
string month = ddlMonth.SelectedItem.Text.Substring(0,3).ToLower();
if (month == string.Empty)
{ }
ds = repo.GetTracker("select * from TrackerDetails where LCase(Month) like '%" + month + "' And LCase(Month) like '" + year + "%'");
DataTable dt = ds.Tables["TrackerDetails"];
dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
Session["TrackerData"] = dt;
Session["Month"] = month;
Session["Year"] = year;
GridTracker.DataMember = "TrackerDetails";
GridTracker.DataSource = Session["TrackerData"];
GridTracker.DataBind();
}
#endregion

protected void btnAdd_Click(object sender, EventArgs e)
{
Response.Redirect("~/Admin/TrackerEdit.aspx?id=0&FormMode=Insert");
}

protected void btnLoad_Click(object sender, EventArgs e)
{
LoadData();

}

}
}

Here is my web.config file

<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime/>
<authorization>
<allow users="?"/>
</authorization>
<sessionState timeout="20"/>
</system.web>
<!--<location path="Admin">
<system.web>
<authorization>
<allow roles="Administrator"/>
<deny users="*"/>
</authorization>
</system.web>
</location>-->
<system.webServer/>
<connectionStrings>

<clear/>
<add name="TrackerConnectionString" connectionString="Data Source= ~\WebTrackingTool\Tracker.accdb Provider=Microsoft.ACE.OLEDB.12.0;" providerName="System.Data.OleDb"/>
<clear/>
</connectionStrings>
</configuration>

Setting a Web Root Folder

$
0
0

Hi All,

I'm not sure if this is the right forum but it seems like a "Getting Started" question.

I have an ASP.NET web app project in Visual Studio 2015, using IIS Express. The simplified folder structure of the project looks like this:

ProjectName
   |
   |
   +--privateFolder
   |
   |
   +--publicFolder
             |
             |
             + -- default.htm

Basically, I want the "publicFolder" to be the root of my web application. All resources served by the application are in publicFolder. I have been partially successful at making this happen by editing the applicationhost.config file so that it has this virtualDirectory entry (note the "\public" at the end):

<virtualDirectory path="/" physicalPath="C:\Users\blahBlah\Desktop\Dev\Sites\Web Sites\ProjectName\public" />

With the above entry in applicationhost.config, the "public" folder is the root of my web application and I am able to browse to a URL likehttp://localhost:3487 and it works. Note that I donot have to put "/public" in the URL because it is mapped to in the virtualDirectory entry shown above. This is my goal, to not have "/public" in the URL but yet to maintain the directory structure I showed above.

Here's the problem though: When I close and then re-start Visual Studio, it re-writes the virtualDirectory entry above, removing the trailing "\public".

Is there a way to tell VS that I want a particular sub-folder in the project to serve as the root?

Add a virtual directory of another domain - IIS 6.1 [Windows 7]

$
0
0

Add a virtual directory of another domain - IIS 6.1 [Windows 7]

I want to add a virtual directory for a folder which is on another domain, is it possible ?

Security Exception

$
0
0

hi everyone ,im getting some error exception that i cant fix, its happen when i deploy my site in an 1one1 shared host, the site works in my local environment

help will be appreciated im using VS Community 2013 ASP.NET 4.5 Web Forms

Server Error in '/' Application.


Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. 

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 

[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Delegate.DelegateConstruct(Object target, IntPtr slot) +0
   Owin.Loader.DefaultLoader..ctor(Func`3 next, Func`2 activator, IEnumerable`1 referencedAssemblies) +69
   Microsoft.Owin.Host.SystemWeb.OwinBuilder.GetAppStartup() +65
   Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +28
   System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +86
   Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

IIS problem

$
0
0

I am using the vs 2010 for automate my application using the Coded UI . Also IE version 9 ,but then i enter 'Tab' through programming is is giving error pop up.

I could not figure out the problem. if Anybdy knws tell me.

Thanks in advanced.

Permalinks using parameters

$
0
0

Hi,

I will like to know how I can change or hide some parameter values I am passing to a page?

Trying to create permalinks for SEO.

I am already using AspNet.FriendlyUrls, it's working for the page names. But I don't know if it's possible or how to use it for parameters. 

My RouteConfig is:

 public static class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            //routes.EnableFriendlyUrls();                     
            var settings = new FriendlyUrlSettings();
            settings.AutoRedirectMode = RedirectMode.Permanent;
            routes.EnableFriendlyUrls(settings);

            //This seems to be wrong
            routes.MapPageRoute("search", "search/{name}/{state}/{zip}/search", "~/search.aspx");
        }
    }

In my main page, where I have the form for searching. This is the jQuery/JavaScript I have for passing the values;

<script type="text/javascript">$(document).ready(function () {$('#Search_btn').click(function (e) {
                e.preventDefault();
                var name = $("#<%= txtName.ClientID %>").val();
                var zip = $("#<%= zipcode.ClientID %>").val();
                var state = $("#state_ddl option:selected").text();
                var params = "name=" + name + "&state=" + state + "&zip=" + zip;
                var url = "<%: ResolveClientUrl("search.aspx?") %>" + params;
                window.location = url;              
            });
        });</script>

My Searc.aspx page;

string name = Request.QueryString["name"];
string state = Request.QueryString["state"];
string zip = Request.QueryString["zip"];

if (!string.IsNullOrEmpty(name) || !string.IsNullOrEmpty(state) || !string.IsNullOrEmpty(zip)) {
//This is currently working fine
//Page displays the results   
SearchNames(name, state, zip);
}

And this is how the url in the search.asp looks like.

This are the parameters I am passing;name= &state= &zip= 

Here state of Florida was searched. 
http://localhost:69160/search?name=&state=FLORIDA&zip=

Is it possible for not needing to use URLRewrite in IIS?

Any help or guidance will be very appreciated.

Thanks. 

Host web pages across multiple web servers - IIS 8.5

$
0
0

We have a .NET based web application hosted on a web server with IIS 8.5We generate .aspx pages for our products on daily basis which are around 25000 now. To share the load on web server we are planing to host the images on a separate server like CDN.

Is there a possibility where we can host the .aspx on separate server but can be still accessed using the existing page URLs?


Urgent help needed with Handler "AboMapperCustom-360752472" has a bad module "IsapiModule" in its module list

$
0
0

I was tested which ever I found on the net and still keep getting error message as below. Someone please guide...

I have granted all access and also register the iis with run %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -I

HTTP Error 500.21 - Internal Server Error

Handler "AboMapperCustom-360752472" has a bad module "IsapiModule" in its module list

<div class="content-container">

Most likely causes:

  • Managed handler is used; however, ASP.NET is not installed or is not installed completely.
  • There is a typographical error in the configuration for the handler module list.
  • During application initialization, either the application initialization feature has set skipManagedModules to true, or a rewrite rule is setting a URL that maps to a managed handler and is also setting SKIP_MANAGED_MODULES=1.
</div>

Schema Name in _MigrationHistory table

$
0
0

Hi All,

I have a .net project with Entity framework 6.0 with MsSql server. I am migrating it to use MySql 6.9.7. In our sql tables we have multiple schema infront of tables: for ex Test._migrationhistory, Test1._migrationhistory and so on. When I am running the updatedatabase command in package manager console, it creates the db with all the tables with schema in mysql, however gives an error in console: 

Table 'MySqlTestDB.__MigrationHistory' doesn't exist

which is because of the statement: 

INSERT INTO `__MigrationHistory`(
`MigrationId`,
`ContextKey`,
`Model`,
`ProductVersion`) VALUES (

It is not searching __MigrationHistory with schema while entering record in it.

Please suggest

IIS 7.5, can not access .xml file publicly, why?

$
0
0

Hi,

We just deployed a MVC web application to a server running IIS 7.5; however, there is an .xml file that cannot be accessed publicly.

If we go to this file via a browser, it produces an 500 error.

ANyone has an idea why? How to fix this?

Thanks,

Claudia

ASMX runs in IIS 6 but not IIS 8

$
0
0

Hi Guys, 

I'm trying to migrate my applications/web services from an old server with IIS 6 to a new server running IIS 8

However it doesn't work in IIS 8.. After entering the required parameters and click on "Invoke" button, "The page cannot be displayed because an internal server error has occurred." appears.

I tried debugging and found that there isn't any problem with the web service but the code inside. The web methods are trying to encrypt and decrypt using - MD5CryptoServiceProvider

Returning a dummy blank string works but when i add this line - MD5CryptoServiceProvider xx = new MD5CryptoServiceProvider(); It returns - The page cannot be displayed because an internal server error has occurred. above invoking the method.

Any help is very much appreciated. 

The Global element 'configuration' has already been declared when adding .net 2.0 web service reference to MVC project

$
0
0

I am getting build failure due to warning in my web.config. Everything was fine before I added .net 2.0 Web service reference to the MVC project. I got warnings of Global element '{element name}' has already been declared for all the elements in my web.config. I do have a WCF service reference declared in the project as well.  Searching has only turned up different issues than the one I am having.  

Is there any way to fix this issue, perhaps by telling the configuration manager to ignore the config file in the referenced Web service or WCF assembly?

I can not use the regular service reference as I am not able to call it via https. Or is there a way to reference the 2.0 web service as the regular service reference that can be invoked via https/ssl connection?

Viewing all 3561 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>