Click here to Skip to main content
15,902,114 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: email is going as spam / not reaching destination Pin
jkirkerx8-Apr-13 8:10
professionaljkirkerx8-Apr-13 8:10 
GeneralRe: email is going as spam / not reaching destination Pin
Jasmine25018-Apr-13 11:07
Jasmine25018-Apr-13 11:07 
GeneralRe: email is going as spam / not reaching destination Pin
jkirkerx8-Apr-13 12:32
professionaljkirkerx8-Apr-13 12:32 
GeneralRe: email is going as spam / not reaching destination Pin
Jasmine25018-Apr-13 13:00
Jasmine25018-Apr-13 13:00 
QuestionAJAX Image Loading Pin
Rockstar_8-Apr-13 1:19
professionalRockstar_8-Apr-13 1:19 
AnswerRe: AJAX Image Loading Pin
Karthik Harve8-Apr-13 1:55
professionalKarthik Harve8-Apr-13 1:55 
QuestionMVC 4 Maintain state of the check box,Drop down list Pin
VishwaKL8-Apr-13 0:34
VishwaKL8-Apr-13 0:34 
Question__EVENTTARGET is undefined Pin
GGev7-Apr-13 23:32
GGev7-Apr-13 23:32 
I have a web page(.aspx), on which I'm loading some user control by jQuery ajax.
Something like this:

JavaScript
$.ajax({
               type: "POST",
               url: "WebService.asmx/GetGrid",
               data: data,
               contentType: "application/json; charset=utf-8",
               dataType: "json",
               success: function(result){
                    $('#divAjaxGridViewContainer').html(result.d);
               },
               error: function(error) {
                   alert("Error");
               }
           });


In WebService.asmx.cs Web Service I have a GetGrid WebMethod which generates and returns the html of user control, that contains grid view. Here is the code:


C#
[WebMethod]
   public string GetPage(object[] criteria)
   {
       Page page = new Page {ViewStateMode = ViewStateMode.Disabled};

       AjaxGridView grid = (AjaxGridView)page.LoadControl("~/Controls/AjaxGridView.ascx");
       grid.ViewStateMode = ViewStateMode.Disabled;

       grid.BindData(criteria);

       HtmlForm form = new HtmlForm {ViewStateMode = ViewStateMode.Disabled};

       form.Controls.Add(grid);

       page.Controls.Add(form);

       string result = String.Empty;

       using (StringWriter output = new StringWriter())
       {
           page.Server.Execute(page, output, false);
           result = output.ToString();
       }
       return result;
   }


AjaxGridView is a user control, that contains a GridView, and binds it to some data depending on some criteria with BindData(criteria) public method.

All this code works fine. I've used this technique several times and it used to work fine.

This time, after loading the html from service onto the page, clicking the controls that should make autopostback (such as asp:Button, asp:DropDownList, asp:CheckBoxList), throws the following js esception:
__EVENTTARGET is undefined

on this part of code:

JavaScript
function __doPostBack(eventTarget, eventArgument) {
       if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
           theForm.__EVENTTARGET.value = eventTarget;
           theForm.__EVENTARGUMENT.value = eventArgument;
           theForm.submit();
       }
   }



Any ideas?
AnswerRe: __EVENTTARGET is undefined Pin
Karthik Harve8-Apr-13 2:01
professionalKarthik Harve8-Apr-13 2:01 
QuestionHow solve (Validation of viewstate MAC failed)? Pin
Jassim Rahma7-Apr-13 0:38
Jassim Rahma7-Apr-13 0:38 
AnswerRe: How solve (Validation of viewstate MAC failed)? Pin
AContractor7-Apr-13 1:48
professionalAContractor7-Apr-13 1:48 
AnswerRe: How solve (Validation of viewstate MAC failed)? Pin
Vani Kulkarni7-Apr-13 20:17
professionalVani Kulkarni7-Apr-13 20:17 
QuestionPlacing & arranging controls on web form Pin
Member 99120916-Apr-13 6:47
Member 99120916-Apr-13 6:47 
AnswerRe: Placing & arranging controls on web form Pin
David C# Hobbyist.6-Apr-13 7:18
professionalDavid C# Hobbyist.6-Apr-13 7:18 
AnswerRe: Placing & arranging controls on web form Pin
jkirkerx7-Apr-13 10:10
professionaljkirkerx7-Apr-13 10:10 
Questionhow to upgrade from iis6 to iis7.5 Pin
Member 87018136-Apr-13 6:35
Member 87018136-Apr-13 6:35 
AnswerRe: how to upgrade from iis6 to iis7.5 Pin
dusty_dex6-Apr-13 7:58
dusty_dex6-Apr-13 7:58 
QuestionUnknown mobile manufacturer and model Pin
Jassim Rahma6-Apr-13 5:43
Jassim Rahma6-Apr-13 5:43 
AnswerRe: Unknown mobile manufacturer and model Pin
Jassim Rahma10-Apr-13 5:03
Jassim Rahma10-Apr-13 5:03 
Questionbypass login Pin
Suman Maji5-Apr-13 1:01
professionalSuman Maji5-Apr-13 1:01 
AnswerRe: bypass login Pin
AContractor5-Apr-13 2:02
professionalAContractor5-Apr-13 2:02 
GeneralRe: bypass login Pin
AmitGajjar5-Apr-13 19:00
professionalAmitGajjar5-Apr-13 19:00 
AnswerRe: bypass login Pin
jayesh.sharma10-Apr-13 3:26
jayesh.sharma10-Apr-13 3:26 
QuestionWhat is the Congiguration manager class in the code and how to you set it in the Project or IDE? Pin
Xarzu4-Apr-13 14:57
Xarzu4-Apr-13 14:57 
AnswerRe: What is the Congiguration manager class in the code and how to you set it in the Project or IDE? Pin
AmitGajjar5-Apr-13 19:05
professionalAmitGajjar5-Apr-13 19:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.