我有一个在ASP.net和C#开发的Web应用程序.我还使用Telerik ASP.NET AJAX进行Web UI.应用程序System.Web.UI.ViewStateException: Invalid viewstate在生产服务器中抛出异常().它在测试服务器中工作正常.而且这个错误是随机抛出的.
System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: x.x.x.x
Port: xxxxx
Referer: http://webaddress/Page.aspx
Path: /Page.aspx
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; CMNTDF; BRI/1; InfoPath.3; BRI/2; .NET4.0C)
ViewState: /wEPDwUILT ... [further contents omitted for this question]
Run Code Online (Sandbox Code Playgroud) 我有一个node.js express app,提供RESTful API,我使用护照进行Facebook身份验证.我在服务器端启用了所有CORS配置,并且能够通过jQuery Ajax使用API.但对于Facebook身份验证,我收到以下错误:
XMLHttpRequest cannot load http://localhost:3000/auth/facebook. The request was redirected to 'https://www.facebook.com/dialog/oauth?response_type=code&redirect_uri=http%…_me%2Cuser_checkins%2Cuser_likes&client_id=12345678&type=web_server', which is disallowed for cross-origin requests that require preflight.
Run Code Online (Sandbox Code Playgroud)
/ auth/facebook端点就是这个.
app.get('/auth/facebook',
passport.authenticate('facebook', {
scope: ['email', 'user_about_me', 'user_checkins', 'user_likes'],
failureRedirect: users.authFailCallback
}), users.signin);
Run Code Online (Sandbox Code Playgroud)
所以基本上它被重定向到Facebook的API(302),它不允许CORS.有什么方法可以解决这个问题吗?或者我需要从服务器端调用Facebook API?
redirect cross-domain node.js facebook-graph-api passport.js
我希望动态地将列表绑定到数据网格,以下代码首次运行,如果再次单击添加,则不会在数据网格中填充.

private List<Item> PopulateItemList()
{
return itemLst;
}
private void btnAdd_Click(object sender, RoutedEventArgs e)
{
Item item = new Item();
item.Item1 = txtItem.Text;
itemLst.Add(item);
grdItem.ItemsSource = PopulateItemList();
}
private List<Item> itemLst = new List<Item>();
private void Page_Loaded(object sender, RoutedEventArgs e)
{
itemLst.Clear();
}
Run Code Online (Sandbox Code Playgroud)
谢谢.
我想在插入或更新新行时插入当前日期时间.每当插入一行时,getdate()都会给出日期时间.但它在行更新时不会自行更新.有没有办法做到这一点?
编辑:我不想使用触发器.

c# ×2
.net ×1
asp.net ×1
cross-domain ×1
iis-7 ×1
node.js ×1
passport.js ×1
redirect ×1
telerik ×1
wpf ×1
wpfdatagrid ×1