Accessing page controls in webmethod

Posted by Nilkanthn under Regular Expressions on 3/18/2011 | Points: 10 | Views : 11596 | Status : [Member] | Replies : 2
Hello,

I want to bind my gridview through javascript.
I have written a code in javascript, i called webmethod. And under that webmethod i want to bind gridview.
but control breaks on the line where i am assigning datasource to gridview.

Is is possible to access gridview vontrol in webmethod or javascript.

Thanks,
Nilkanth




Responses

Posted by: Gsolvers on: 3/18/2011 [Member] Starter | Points: 25

Up
0
Down
Can i look at the code?

Best Regards,

VG
www.TeacherJi.com

Nilkanthn, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nilkanthn on: 3/18/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,
Here is the code,

function AddComment(id, RowIndexadd) {

var row;
PageMethods.AddCommentToBlog(id, textval, row, OnSuccess);
}


[WebMethod]
public static int AddCommentToBlog(int HsId, string comment, int row)
{
User_UserHomePage userhome = new User_UserHomePage();
userhome.AddCommentBlog(HsId, comment);
userhome.grdHotSptty.DataSource = userhome.bllHotSpotty.GetCommentDetailsDisplay(HsId);
userhome.grdHotSptty.DataBind();
return row;
}



When controls comes on the line :
"userhome.grdHotSptty.DataSource = userhome.bllHotSpotty.GetCommentDetailsDisplay(HsId);"
It comes out from the function.

Thanks,
Nilkanth

Nilkanthn, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response