小编Pre*_*ent的帖子

将system.web applicationpool添加到web.config会导致500内部服务器错误

我正在尝试将以下内容添加到我的webconfig中

<system.web>
    <applicationPool maxConcurrentRequestsPerCPU="5000" maxConcurrentThreadsPerCPU="0" requestQueueLimit="5000"/>
</system.web>
Run Code Online (Sandbox Code Playgroud)

但是,当我这样做时,出现以下错误。

The configuration section 'applicationPool' cannot be read because it is missing a section declaration 
Run Code Online (Sandbox Code Playgroud)

如何为此添加节声明?

asp.net web-config iis-7.5

5
推荐指数
1
解决办法
6047
查看次数

从数据库中解析xml

目前我将xml存储在ms sql dbase而不是文件中.这是一个小样本.

<NewDataSet>
<Table1>
<billTo_lastName>asdf</billTo_lastName>
<orderAmount>160.00</orderAmount>
<billTo_street1>asdf</billTo_street1>
<card_accountNumber>############1111</card_accountNumber>
</Table1>
</NewDataSet>
Run Code Online (Sandbox Code Playgroud)

目前我将结果返回到Datable.

解析上述内容并在页面上显示的最佳方法是什么.页面显示仅供参考.不会对xml进行额外的处理.

我希望页面能够显示这些内容.

billTo_lastName: asdf
orderAmount: 160.00
etc.
Run Code Online (Sandbox Code Playgroud)

c# xml asp.net

5
推荐指数
1
解决办法
1万
查看次数

获取浏览器中显示的当前 URL

目前我正在尝试获取浏览器中显示的当前 URL。

如果我使用

Request.Path 
Run Code Online (Sandbox Code Playgroud)

我得到https://this.website.com:443/Default.aspx,这在技术上是正确的。

但是浏览器本身显示的 URL 是https://this.website.com/

使用任何请求选项仍将显示 Default.aspx。

我需要最终检测浏览器中的 url 是否为https://this.website.comhttp://this.website.com/Default.aspx,然后重定向到 Default.aspx(如果不存在)。

顺便说一句,更复杂的是我的 web.config 中的 https 重定向。

c# asp.net url request

3
推荐指数
1
解决办法
1万
查看次数

如何从SEO友好的URL获取查询字符串参数?

我使用普通的URL参数切换到SEO友好的URL.例如,我已经离开了......

http://www.example.net/mypage.aspx?id=1
Run Code Online (Sandbox Code Playgroud)

......对此:

http://www.example.net/mypage/1
Run Code Online (Sandbox Code Playgroud)

使用JavaScript或jQuery,将id变量设为1的最佳方法是什么?

我目前使用这样的函数:

// get the values from the query string.
function GetQueryStringParams(sParam) {
var sPageURL = window.location.search.substring(1);

var sURLVariables = sPageURL.split('&');

for (var i = 0; i < sURLVariables.length; i++) {
    var sParameterName = sURLVariables[i].split('=');
    if (sParameterName[0] == sParam) {
        return sParameterName[1];
    }
}
Run Code Online (Sandbox Code Playgroud)

有没有更好的方法,或者我是不是通过/??分割URL ?你会如何处理多个参数?

http://www.example.net/mypage/1/2/3/4/5

javascript url jquery

2
推荐指数
1
解决办法
1984
查看次数

过滤多列上的列表

我需要根据多个列过滤我的列表.这是我需要搜索的课程

public class psdata
    {
        public int ID { get; set; }
        public string Customer { get; set; }
        public string Address { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string Zip { get; set; }
        public decimal? Identification { get; set; }
        public decimal? Assesment { get; set; }
        public decimal? PayoffLedger { get; set; }
        public decimal? RentRestrictions { get; set; }
        public decimal? CCR { get; …
Run Code Online (Sandbox Code Playgroud)

c# linq asp.net

1
推荐指数
1
解决办法
4551
查看次数

获取包含数百万个文件的第一个文件夹

我必须在包含数百万个文件的文件夹上进行一些房屋清洁.最终我想抓取文件然后查看它们是否存在于数据库中.但我需要首先抓取文件而不会阻塞程序.

我试着去使用的路线

var file = Directory.GetFiles(uri, "*.*").FirstOrDefault();
Run Code Online (Sandbox Code Playgroud)

但这需要永远运行.因为文件的数量.

有没有更好的方法来获取不会花这么长时间的文件?

c#

1
推荐指数
1
解决办法
793
查看次数

将http post变量转换为匿名类型

我有一个ashx页面设置来处理来自服务的传入http帖子.

而且我想知道是否有更好的方法来填充我的匿名类型而不是手动执行.例如.

public class myclass
{
    [key]
    public int ID { get; set; }
    public int field1 { get; set; }
    public int field2 { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

然后在我的ashx页面上

myclass mc = new myclass();

mc.field1 = context.Request.Form[field1];
mc.field2 = context.Request.Form[field2];
Run Code Online (Sandbox Code Playgroud)

是不是只有一种方法来转换或转换为我的类型?

myclass mc = new myclass();
mc = context.Request.Form;
Run Code Online (Sandbox Code Playgroud)

c# asp.net webforms

0
推荐指数
1
解决办法
93
查看次数

标签 统计

asp.net ×5

c# ×5

url ×2

iis-7.5 ×1

javascript ×1

jquery ×1

linq ×1

request ×1

web-config ×1

webforms ×1

xml ×1