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

ASP.NET

 
GeneralRe: Countdown timer with updatepanel Pin
treuveni1-Apr-12 20:45
treuveni1-Apr-12 20:45 
QuestionDeleting row of Grid on button click Pin
Chandan Aryan26-Mar-12 1:09
Chandan Aryan26-Mar-12 1:09 
AnswerRe: Deleting row of Grid on button click Pin
treuveni26-Mar-12 20:26
treuveni26-Mar-12 20:26 
GeneralRe: Deleting row of Grid on button click Pin
mla997427-Mar-12 18:01
mla997427-Mar-12 18:01 
AnswerRe: Deleting row of Grid on button click Pin
Raman Ghantiyala27-Mar-12 3:33
Raman Ghantiyala27-Mar-12 3:33 
AnswerRe: Deleting row of Grid on button click Pin
Sharad CG27-Mar-12 20:35
Sharad CG27-Mar-12 20:35 
AnswerRe: Deleting row of Grid on button click Pin
Anudeep Jaiswal - MCA28-Mar-12 22:57
Anudeep Jaiswal - MCA28-Mar-12 22:57 
QuestionTroubles with calling a PageMethod from javascript [solved] Pin
Calla25-Mar-12 23:07
Calla25-Mar-12 23:07 
I've been struggling with the same problem for a few days now without getting anywhere. In my aspx page I try to call a PageMethod from a javascript and then inserting the result of that call into a div.

MyPage.aspx
XML
<ajaxToolkit:ToolkitScriptManager runat="server" ID="ScriptManager1" EnablePageMethods="true">
   <Scripts>
      <asp:ScriptReference Path="~/javascript/myscript.js" />
   </Scripts>
</ajaxToolkit:ToolkitScriptManager>
...
...
<a href="javascript:myFunction();">Click to run script</a>
...
...
<div id='theDiv'></div>


MyPage.aspx.cs
C#
[System.Web.Services.WebMethod]
public static string ReturnTheString()
{
   return "This is the string returned";
}


And finally my javascript function where everything goes wrong myscript.js
JavaScript
function myFunction()
{
   PageMethods.ReturnTheString(OnSucceeded, OnFailed);
}

function OnSucceeded(result)
{
   var myDiv = document.getElementById('theDiv');
   myDiv.innerHTML = result;
}

function OnFailed(error)
{
   alert(error.get_message());
}


The problem is that I don't get the expexted "This is the string returned" as result in my OnSucceeded js function. And when I debug my website and set up a breakpoint in ReturnTheString() the code never runs.. My result parameter is sometimes just empty and sometimes has the value of almost my whole page (starting with

modified 27-Mar-12 2:51am.

AnswerRe: Troubles with calling a PageMethod from javascript Pin
Calla26-Mar-12 20:51
Calla26-Mar-12 20:51 
Questioncause of these errors? Pin
ozturkmuhammed24-Mar-12 12:11
ozturkmuhammed24-Mar-12 12:11 
AnswerRe: cause of these errors? Pin
Eddy Vluggen25-Mar-12 3:34
professionalEddy Vluggen25-Mar-12 3:34 
QuestionUpdatePanel with dropdown control. Pin
vipinkrr24-Mar-12 6:22
vipinkrr24-Mar-12 6:22 
AnswerRe: UpdatePanel with dropdown control. Pin
Abhinav S24-Mar-12 16:31
Abhinav S24-Mar-12 16:31 
AnswerRe: UpdatePanel with dropdown control. Pin
MaulikDusara26-Mar-12 2:55
MaulikDusara26-Mar-12 2:55 
Questionquiz application Pin
daya patel24-Mar-12 5:24
daya patel24-Mar-12 5:24 
AnswerRe: quiz application Pin
Abhinav S24-Mar-12 16:28
Abhinav S24-Mar-12 16:28 
Questionpaging in gridview? Pin
murali_utr23-Mar-12 23:47
murali_utr23-Mar-12 23:47 
AnswerRe: paging in gridview? Pin
murali_utr23-Mar-12 23:56
murali_utr23-Mar-12 23:56 
QuestionAutoCompleteExtender in AjaxToolkit? Pin
murali_utr23-Mar-12 23:36
murali_utr23-Mar-12 23:36 
AnswerRe: AutoCompleteExtender in AjaxToolkit? Pin
murali_utr26-Mar-12 4:01
murali_utr26-Mar-12 4:01 
QuestionNeed of asp.net code for offered courses Pin
Shazia Nawaz23-Mar-12 21:21
Shazia Nawaz23-Mar-12 21:21 
AnswerRe: Need of asp.net code for offered courses Pin
Abhinav S24-Mar-12 0:13
Abhinav S24-Mar-12 0:13 
AnswerRe: Need of asp.net code for offered courses Pin
Shivapragasam24-Mar-12 2:27
Shivapragasam24-Mar-12 2:27 
GeneralRe: Need of asp.net code for offered courses Pin
Shazia Nawaz24-Mar-12 23:36
Shazia Nawaz24-Mar-12 23:36 
GeneralRe: Need of asp.net code for offered courses Pin
shreekar27-Mar-12 9:37
shreekar27-Mar-12 9:37 

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.