Click here to Skip to main content
16,005,491 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Displaying asp.net control on an html Page. Pin
_AK_16-Apr-07 0:42
_AK_16-Apr-07 0:42 
GeneralRe: Displaying asp.net control on an html Page. Pin
Rajiya16-Apr-07 0:52
Rajiya16-Apr-07 0:52 
GeneralRe: Displaying asp.net control on an html Page. Pin
_AK_16-Apr-07 0:53
_AK_16-Apr-07 0:53 
AnswerRe: Displaying asp.net control on an html Page. Pin
TRK@UK16-Apr-07 1:44
TRK@UK16-Apr-07 1:44 
AnswerRe: Displaying asp.net control on an html Page. Pin
Sandeep Akhare16-Apr-07 1:51
Sandeep Akhare16-Apr-07 1:51 
QuestionHow to Stop PostBack of Asp Button Pin
Kuricheti15-Apr-07 23:57
Kuricheti15-Apr-07 23:57 
AnswerRe: How to Stop PostBack of Asp Button Pin
TRK@UK16-Apr-07 0:31
TRK@UK16-Apr-07 0:31 
GeneralRe: How to Stop PostBack of Asp Button Pin
Kuricheti16-Apr-07 2:52
Kuricheti16-Apr-07 2:52 
Hi TRK@UK,

Thanks for the response, this is working fine as expected.

I tried something more...
In Page Load
--
Object objAjax = Request.QueryString["from"];
        if (objAjax != null)
        {
            Response.Clear();
            Response.Write("1");
            Response.End();
        }

        //Button1.Attributes.Add("OnClick", " if(TextBox1.value=='hari'){return true}else{return false};");
        Button1.Attributes.Add("OnClick", " var finalval = chkText(); if(finalval == false){return false;}"); 

---

<script language="javascript" type="text/javascript">
    var XmlHttp;   
    function chkText()
    {
      try
        {
           XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e)
        {
           try
           {
              XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
           }
           catch(e1)
           {
              XmlHttp = null;
           }
        }
            //Creating object of XMLHTTP in Mozilla and Safari
        if(!XmlHttp && typeof XMLHttpRequest != "undefined")
        {
           XmlHttp = new XMLHttpRequest();
        }           
        if(XmlHttp)
        {
              try
              {
                XmlHttp.onreadystatechange = HandleResponse;
                XmlHttp.open("POST", "CallingServerFunctionUsingAjax.aspx?from=Ajax",true);
                XmlHttp.send(null);                
                if(XmlHttp.readyState==1)
                {
                    return false;
                }
              }
           catch(e2)
           {
              alert(e2);
           }
        }      
}


function HandleResponse()
    {
      try
      {                 
       if(XmlHttp.readyState == 4)
        {
          if(XmlHttp.status == 200)   
            {
                 var retval=XmlHttp.responseText;                                                                                                 
                  switch(retval)
                  {                      
                      case "1":                                                                                      
                                 return false;
                                  break;                                                     
                                 
                      default:                                   
                                 break;
                  }
             }
           else
             {
                alert("Problem with saving data");
             }
        }   
    }
    catch(e)
    {
      alert("Error");
    }
  }  
    
    </script>



But the function chkText() is not acepting the return value....
What is the problem.........



Thanks
Hari
AnswerRe: How to Stop PostBack of Asp Button Pin
RichardGrimmer16-Apr-07 0:46
RichardGrimmer16-Apr-07 0:46 
GeneralRe: How to Stop PostBack of Asp Button Pin
Kuricheti17-Apr-07 2:11
Kuricheti17-Apr-07 2:11 
Questionremove row using onitemdatabound Pin
freeisgood15-Apr-07 23:41
freeisgood15-Apr-07 23:41 
QuestionNeed URL of page which opens my popup window Pin
geek-age15-Apr-07 23:19
geek-age15-Apr-07 23:19 
QuestionHow to apply custom styles to ajax tab control Pin
vvijaykrishna15-Apr-07 23:11
vvijaykrishna15-Apr-07 23:11 
Questionhow to use ajax calender? Pin
neodeaths15-Apr-07 23:03
neodeaths15-Apr-07 23:03 
AnswerRe: how to use ajax calender? Pin
TRK@UK16-Apr-07 1:34
TRK@UK16-Apr-07 1:34 
GeneralRe: how to use ajax calender? Pin
neodeaths16-Apr-07 16:31
neodeaths16-Apr-07 16:31 
GeneralRe: how to use ajax calender? Pin
TRK@UK17-Apr-07 1:18
TRK@UK17-Apr-07 1:18 
QuestionParser error Pin
monuSaini15-Apr-07 22:54
monuSaini15-Apr-07 22:54 
QuestionRe: Parser error Pin
Sandeep Akhare22-Apr-07 21:47
Sandeep Akhare22-Apr-07 21:47 
Questionhow do i get datetimepicker for my asp.net2 Pin
neodeaths15-Apr-07 22:13
neodeaths15-Apr-07 22:13 
AnswerRe: how do i get datetimepicker for my asp.net2 Pin
Leyu16-Apr-07 4:29
Leyu16-Apr-07 4:29 
QuestionFiles to Deploy in ASP.NET 2.0 (Urgent) Pin
IamMohan15-Apr-07 22:02
IamMohan15-Apr-07 22:02 
AnswerRe: Files to Deploy in ASP.NET 2.0 (Urgent) Pin
N a v a n e e t h15-Apr-07 22:41
N a v a n e e t h15-Apr-07 22:41 
GeneralRe: Files to Deploy in ASP.NET 2.0 (Urgent) Pin
IamMohan15-Apr-07 23:21
IamMohan15-Apr-07 23:21 
GeneralRe: Files to Deploy in ASP.NET 2.0 (Urgent) Pin
IamMohan20-May-07 20:48
IamMohan20-May-07 20:48 

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.