难道__doPostBack()将永远发送GET请求? [英] Is it possible that __doPostBack() would ever send a GET request?

查看:257
本文介绍了难道__doPostBack()将永远发送GET请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在与Telerik的radgrid控件的一个问题,我想启用多个行选择。我也想只要选择或取消一行去到服务器。我创建了一个JavaScript函数来处理Grid的客户端事件(OnRowSelected和OnRowDeSelected)。功能如下:

I'm having a problem with telerik RadGrid, I want to enable multiple row selection. I also want to go to the server whenever a row is selected or deselected. I created a javascript function to handle the Grid's client side events (OnRowSelected, and OnRowDeSelected). The functions look like this:

 function onOperationRowSelected(sender, eventArgs) {
            __doPostBack("<%=myControl.ClientID %>", "rowSelected:" + eventArgs.get_itemIndexHierarchical());
        }

的另一功能是非常相似,唯一的区别是,它发送字符串rowDeselcted而不是rowSelected。

The other function is very similar, the only difference is that it sends the string "rowDeselcted" instead of "rowSelected".

在我的Page_Load检查,看看是否请求是使用的IsPostBack如果是这样,我检查,看它是否是一个rowSelected或rowdeselected POST请求。

On Page_Load I check to see if the request is a Post request using "IsPostBack" and if so, I check to see if it's a rowSelected or rowdeselected.

我的问题是,当我选择在我的网格中的第一原料,POST请求发生(预计),但是,当我选择第二行,GET请求发出后,它(显然)将导致的IsPostBack返回假。

My problem is when I select a first raw on my grid, a Post request happens (which is expected), however, when I select the second row, a GET request is issued, which (obviously) will result in IsPostBack returning false.

我缺少的是在这里吗?

What am I missing here?



修改我只是检查Request对象,发现列举HTTPMethod属性值是POST。为什么它是一个HTTP POST请求,并返回的IsPostBack假??


I just checked the Request object and found that the HttpMethod property value is "POST". How come it's an HTTP POST request and IsPostBack returns false??

推荐答案

您确定的GET请求有正确的事件参数?结果
我认为有别的东西,正在GET请求。可能是一些AJAX魔术由电网,一些资源或AJAX PageMethod的电话或URL重写事物或类似的东西。

Are you sure the GET request has the right event argument?
I think there is something else that is making the GET request. Probably some AJAX magic by that grid, some resource or AJAX PageMethod call or URL rewriting thing or something like that.

时的页面名称Default.aspx的什么一样?有时候,在某些浏览器(不记得细节)获得的图像左右(不记得确切的情况),使得浏览器也打samefolder /URL,这将打开默认页面。

Is the page name default.aspx or something alike? Sometimes in some browser (can't remember details) getting an image or so (can't remember exact situation) makes the browser also hits the "samefolder/" URL, which opens the default page.

请与萤火请求,看看它告诉。

Check the request with FireBug and see what it tells.

这篇关于难道__doPostBack()将永远发送GET请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆