小编Nie*_*svh的帖子

OnClientClick ="返回确认('您确定要删除');"

我正在使用此代码进行删除确认.当我点击链接按钮时,它会要求我确认,但是第一次单击"确定"时,记录不会被删除(仅限第一次).

此后该记录成功删除.

<asp:LinkButton ID="LinkBtnDelete" runat="server" 
OnClientClick="return confirm('Are you sure you want delete');" 
CommandName="Delete">Delete 
</asp:LinkButton> 
Run Code Online (Sandbox Code Playgroud)

任何帮助都会很棒,谢谢.

javascript asp.net

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

在python中的gdata上使用OAuth2和服务帐户

我想用来data.photos.service.PhotosService从Picasa推送和拉取照片.我从Google控制台获得了一个服务密钥文件XXXXXXXX-privatekey.p12,现在我正在尝试使用谷歌的密钥进行身份验证.

使用appengine的OAUTH2文档让我相信使用以下内容是有用的:

f = file(settings.SITE_ROOT + '/aurora/' + settings.PRIVATE_KEY, 'rb')
key = f.read()
f.close()

credentials = SignedJwtAssertionCredentials(settings.SERVICE_ACCOUNT_NAME, key, scope = 'http://picasaweb.google.com/data https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile')
http = httplib2.Http()
http = credentials.authorize(http)
service = build("oauth2", "v2", http=http)
user_info = None
try:
  user_info = service.userinfo().get().execute()
  # neither of these two methods work
  #gd_client.SetOAuthInputParameters(signature_method = gdata.auth.OAuthSignatureMethod.RSA_SHA1, consumer_key = "asdfasdfasdf.apps.googleusercontent.com", rsa_key = key, two_legged_oauth = True, requestor_id = user_info.get('email'))
  #gd_client.auth_token = gdata.gauth.TwoLeggedOAuthRsaToken(consumer_key = user_info.get('email'), rsa_private_key = key, requestor_id = user_info.get('email'))
except errors.HttpError, e:
  logging.error('An …
Run Code Online (Sandbox Code Playgroud)

google-app-engine picasa gdata oauth-2.0 google-api-client

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